diff options
| author | Stephan Bösebeck <stephan.boesebeck@holidayinsider.com> | 2016-01-15 15:55:00 +0100 |
|---|---|---|
| committer | Stephan Bösebeck <stephan.boesebeck@holidayinsider.com> | 2016-01-15 15:55:00 +0100 |
| commit | e44c30f2030dd4c481a6e38e9392f147be7b0ae2 (patch) | |
| tree | f784be18d4465b53ccd8b21a697b18f7630cf988 | |
| parent | 28964bb04b3d2b6ccd5091218fec63a97fd588c9 (diff) | |
| download | qmk_firmware-e44c30f2030dd4c481a6e38e9392f147be7b0ae2.tar.gz qmk_firmware-e44c30f2030dd4c481a6e38e9392f147be7b0ae2.zip | |
using keymap_german_osx.h more, adding macros for CTRL/CMD-V combination
| -rw-r--r-- | keyboard/ergodox_ez/keymaps/keymap_osx_de.c | 89 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_german_osx.h | 100 |
2 files changed, 164 insertions, 25 deletions
diff --git a/keyboard/ergodox_ez/keymaps/keymap_osx_de.c b/keyboard/ergodox_ez/keymaps/keymap_osx_de.c index 91f2c33f3..cc9076eec 100644 --- a/keyboard/ergodox_ez/keymaps/keymap_osx_de.c +++ b/keyboard/ergodox_ez/keymaps/keymap_osx_de.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #include "ergodox_ez.h" | 1 | #include "ergodox_ez.h" |
| 2 | #include "debug.h" | 2 | #include "debug.h" |
| 3 | #include "action_layer.h" | 3 | #include "action_layer.h" |
| 4 | #include "keymap_extras/keymap_german.h" | 4 | #include "keymap_extras/keymap_german_osx.h" |
| 5 | 5 | ||
| 6 | #define BASE 0 // default layer | 6 | #define BASE 0 // default layer |
| 7 | #define SYMB 1 // symbols | 7 | #define SYMB 1 // symbols |
| @@ -9,7 +9,9 @@ | |||
| 9 | #define CRSR 3 // media keys | 9 | #define CRSR 3 // media keys |
| 10 | #define NUMB 4 // number keys | 10 | #define NUMB 4 // number keys |
| 11 | 11 | ||
| 12 | 12 | #define M_CTRL_CMDV 1 | |
| 13 | #define M_CTRL_CMDC 2 | ||
| 14 | #define M_MEH_SH_ACUT 3 | ||
| 13 | 15 | ||
| 14 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 16 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 15 | /* Keymap 0: Basic layer | 17 | /* Keymap 0: Basic layer |
| @@ -37,21 +39,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 37 | // Otherwise, it needs KC_* | 39 | // Otherwise, it needs KC_* |
| 38 | [BASE] = KEYMAP( // layer 0 : default | 40 | [BASE] = KEYMAP( // layer 0 : default |
| 39 | // left hand | 41 | // left hand |
| 40 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_V), | 42 | KC_ESC, DE_1, DE_2, DE_3, DE_4, DE_5, M(M_CTRL_CMDV), |
| 41 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI, | 43 | KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, KC_LGUI, |
| 42 | TG(3), KC_A, KC_S, KC_D, KC_F, KC_G, | 44 | TG(3), DE_A, DE_S, DE_D, DE_F, DE_G, |
| 43 | KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LALT, | 45 | KC_LSFT, CTL_T(DE_Y), DE_X, DE_C, DE_V, DE_B, KC_LALT, |
| 44 | LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT,KC_RGHT, | 46 | LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT,KC_RGHT, |
| 45 | TG(2), MEH_T(LSFT(DE_ACUT)), | 47 | TG(2), M(M_MEH_SH_ACUT), //MEH_T(LSFT(DE_ACUT)), //need to create macro for that |
| 46 | KC_HOME, | 48 | KC_HOME, |
| 47 | KC_BSPC,KC_DEL,KC_END, | 49 | KC_BSPC,KC_DEL, KC_END, |
| 48 | // right hand | 50 | // right hand |
| 49 | LGUI(KC_C), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, | 51 | M(M_CTRL_CMDC), DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS, |
| 50 | KC_RGUI, KC_Y, KC_U, KC_I, KC_O, KC_P, DE_UE, | 52 | KC_RGUI, DE_Z, DE_U, DE_I, DE_O, DE_P, DE_UE, |
| 51 | KC_H, KC_J, KC_K, KC_L, KC_SCLN,LT(MDIA,DE_AE), | 53 | DE_H, DE_J, DE_K, DE_L, DE_OE,LT(MDIA,DE_AE), |
| 52 | KC_RALT,KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, | 54 | KC_RALT, DE_N, DE_M, DE_COMM,DE_DOT, CTL_T(DE_MINS), KC_RSFT, |
| 53 | KC_UP, KC_DOWN,LGUI(KC_LSFT),KC_RBRC, LT(SYMB,KC_BSLS), | 55 | KC_UP, KC_DOWN,LGUI(KC_LSFT),DE_PLUS, LT(SYMB,DE_HASH), |
| 54 | ALL_T(DE_ACUT), TG(4), | 56 | ALL_T(DE_ACUT), TG(4), |
| 55 | KC_PGUP, | 57 | KC_PGUP, |
| 56 | KC_PGDN,KC_ENT, KC_SPC | 58 | KC_PGDN,KC_ENT, KC_SPC |
| 57 | ), | 59 | ), |
| @@ -60,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 60 | * ,--------------------------------------------------. ,--------------------------------------------------. | 62 | * ,--------------------------------------------------. ,--------------------------------------------------. |
| 61 | * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | | 63 | * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | |
| 62 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | 64 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| |
| 63 | * | | | | ! | ? | | | | | \ | [ | ] | | | # | F12 | | 65 | * | | < | > | ! | ? | | | | | \ | [ | ] | | | # | F12 | |
| 64 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | 66 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| |
| 65 | * | | # | $ | \ | / | . |------| |------| / | ( | ) | { | } | | | 67 | * | | # | $ | \ | / | . |------| |------| / | ( | ) | { | } | | |
| 66 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | 68 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| |
| @@ -80,9 +82,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 80 | [SYMB] = KEYMAP( | 82 | [SYMB] = KEYMAP( |
| 81 | // left hand | 83 | // left hand |
| 82 | KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, | 84 | KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, |
| 83 | KC_TRNS,KC_GRV,LSFT(KC_GRV),DE_EXLM,DE_QST,KC_TRNS,KC_TRNS, | 85 | KC_TRNS,DE_LESS,DE_MORE,DE_EXLM,DE_QST, KC_TRNS,KC_TRNS, |
| 84 | KC_TRNS,DE_HASH,DE_DLR, LALT(LSFT(KC_7)),DE_SLSH,KC_DOT, | 86 | KC_TRNS,DE_HASH,DE_DLR, DE_BSLS,DE_SLSH,KC_DOT, |
| 85 | KC_TRNS,KC_TRNS,DE_LESS,DE_PERC,LALT(KC_7),LALT(KC_N),KC_TRNS, | 87 | KC_TRNS,KC_TRNS,DE_LESS,DE_PERC,DE_PIPE,DE_TILD,KC_TRNS, |
| 86 | KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, | 88 | KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, |
| 87 | KC_TRNS,KC_TRNS, | 89 | KC_TRNS,KC_TRNS, |
| 88 | KC_TRNS, | 90 | KC_TRNS, |
| @@ -187,15 +189,52 @@ const uint16_t PROGMEM fn_actions[] = { | |||
| 187 | 189 | ||
| 188 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | 190 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) |
| 189 | { | 191 | { |
| 192 | static uint16_t start; | ||
| 190 | // MACRODOWN only works in this function | 193 | // MACRODOWN only works in this function |
| 191 | switch(id) { | 194 | switch(id) { |
| 192 | case 0: | 195 | case 0: |
| 193 | if (record->event.pressed) { | 196 | if (record->event.pressed) { |
| 194 | register_code(KC_RSFT); | 197 | register_code(KC_RSFT); |
| 195 | } else { | 198 | } else { |
| 196 | unregister_code(KC_RSFT); | 199 | unregister_code(KC_RSFT); |
| 197 | } | 200 | } |
| 198 | break; | 201 | break; |
| 202 | case 1: | ||
| 203 | if (record->event.pressed) { | ||
| 204 | start = timer_read(); | ||
| 205 | return MACRO(D(LCTRL), END); | ||
| 206 | } else { | ||
| 207 | if (timer_elapsed(start) > 150) { | ||
| 208 | return MACRO(U(LCTRL), END); | ||
| 209 | } else { | ||
| 210 | return MACRO(U(LCTRL), D(LGUI), T(V), U(LGUI), END); | ||
| 211 | } | ||
| 212 | } | ||
| 213 | break; | ||
| 214 | case 2: | ||
| 215 | if (record->event.pressed) { | ||
| 216 | start = timer_read(); | ||
| 217 | return MACRO(D(LCTRL),END); | ||
| 218 | } else { | ||
| 219 | if (timer_elapsed(start) > 150){ | ||
| 220 | return MACRO(U(LCTRL),END); | ||
| 221 | } else { | ||
| 222 | return MACRO(U(LCTRL),D(LGUI),T(C),U(LGUI),END); | ||
| 223 | } | ||
| 224 | } | ||
| 225 | break; | ||
| 226 | case 3: | ||
| 227 | if (record->event.pressed) { | ||
| 228 | start = timer_read(); | ||
| 229 | return MACRO(D(LCTRL),D(LSFT),D(LALT),END); | ||
| 230 | } else { | ||
| 231 | if (timer_elapsed(start) > 150){ | ||
| 232 | return MACRO(U(LCTRL),U(LSFT),U(LALT),END); | ||
| 233 | } else { | ||
| 234 | return MACRO(U(LCTRL),U(LALT),T(EQL),U(LSFT),END); //cannot use DE_ACUT here, as macro needs KC_ prefix | ||
| 235 | } | ||
| 236 | } | ||
| 237 | break; | ||
| 199 | } | 238 | } |
| 200 | return MACRO_NONE; | 239 | return MACRO_NONE; |
| 201 | }; | 240 | }; |
diff --git a/quantum/keymap_extras/keymap_german_osx.h b/quantum/keymap_extras/keymap_german_osx.h new file mode 100644 index 000000000..b011561e2 --- /dev/null +++ b/quantum/keymap_extras/keymap_german_osx.h | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | #ifndef KEYMAP_GERMAN_OSX | ||
| 2 | #define KEYMAP_GERMAN_OSX | ||
| 3 | |||
| 4 | #ifdef KEYMAP_GERMAN | ||
| 5 | #warning redefining german keys | ||
| 6 | #endif | ||
| 7 | #include "keymap_common.h" | ||
| 8 | |||
| 9 | // Alt gr | ||
| 10 | |||
| 11 | // normal characters | ||
| 12 | #define DE_Z KC_Y | ||
| 13 | #define DE_Y KC_Z | ||
| 14 | |||
| 15 | #define DE_A KC_A | ||
| 16 | #define DE_B KC_B | ||
| 17 | #define DE_C KC_C | ||
| 18 | #define DE_D KC_D | ||
| 19 | #define DE_E KC_E | ||
| 20 | #define DE_F KC_F | ||
| 21 | #define DE_G KC_G | ||
| 22 | #define DE_H KC_H | ||
| 23 | #define DE_I KC_I | ||
| 24 | #define DE_J KC_J | ||
| 25 | #define DE_K KC_K | ||
| 26 | #define DE_L KC_L | ||
| 27 | #define DE_M KC_M | ||
| 28 | #define DE_N KC_N | ||
| 29 | #define DE_O KC_O | ||
| 30 | #define DE_P KC_P | ||
| 31 | #define DE_Q KC_Q | ||
| 32 | #define DE_R KC_R | ||
| 33 | #define DE_S KC_S | ||
| 34 | #define DE_T KC_T | ||
| 35 | #define DE_U KC_U | ||
| 36 | #define DE_V KC_V | ||
| 37 | #define DE_W KC_W | ||
| 38 | #define DE_X KC_X | ||
| 39 | |||
| 40 | #define DE_0 KC_0 | ||
| 41 | #define DE_1 KC_1 | ||
| 42 | #define DE_2 KC_2 | ||
| 43 | #define DE_3 KC_3 | ||
| 44 | #define DE_4 KC_4 | ||
| 45 | #define DE_5 KC_5 | ||
| 46 | #define DE_6 KC_6 | ||
| 47 | #define DE_7 KC_7 | ||
| 48 | #define DE_8 KC_8 | ||
| 49 | #define DE_9 KC_9 | ||
| 50 | |||
| 51 | #define DE_DOT KC_DOT | ||
| 52 | #define DE_COMM KC_COMM | ||
| 53 | |||
| 54 | #define DE_SS KC_MINS | ||
| 55 | #define DE_AE KC_QUOT | ||
| 56 | #define DE_UE KC_LBRC | ||
| 57 | #define DE_OE KC_SCLN | ||
| 58 | |||
| 59 | #define DE_CIRC KC_NUBS // accent circumflex ^ and ring ° | ||
| 60 | #define DE_ACUT KC_EQL // accent acute ´ and grave ` | ||
| 61 | #define DE_PLUS KC_RBRC // + and * and ~ | ||
| 62 | #define DE_HASH KC_BSLS // # and ' | ||
| 63 | #define DE_LESS KC_GRV // < and > and | | ||
| 64 | #define DE_MINS KC_SLSH // - and _ | ||
| 65 | |||
| 66 | // shifted characters | ||
| 67 | #define DE_RING LSFT(DE_CIRC) // ° | ||
| 68 | #define DE_EXLM LSFT(KC_1) // ! | ||
| 69 | #define DE_DQOT LSFT(KC_2) // " | ||
| 70 | #define DE_PARA LSFT(KC_3) // § | ||
| 71 | #define DE_DLR LSFT(KC_4) // $ | ||
| 72 | #define DE_PERC LSFT(KC_5) // % | ||
| 73 | #define DE_AMPR LSFT(KC_6) // & | ||
| 74 | #define DE_SLSH LSFT(KC_7) // / | ||
| 75 | #define DE_LPRN LSFT(KC_8) // ( | ||
| 76 | #define DE_RPRN LSFT(KC_9) // ) | ||
| 77 | #define DE_EQL LSFT(KC_0) // = | ||
| 78 | #define DE_QST LSFT(DE_SS) // ? | ||
| 79 | #define DE_GRV LSFT(DE_ACUT) // ` | ||
| 80 | #define DE_ASTR LSFT(DE_PLUS) // * | ||
| 81 | #define DE_QUOT LSFT(DE_HASH) // ' | ||
| 82 | #define DE_MORE LSFT(DE_LESS) // > | ||
| 83 | #define DE_COLN LSFT(KC_DOT) // : | ||
| 84 | #define DE_SCLN LSFT(KC_COMM) // ; | ||
| 85 | #define DE_UNDS LSFT(DE_MINS) // _ | ||
| 86 | |||
| 87 | // Alt-ed characters | ||
| 88 | #define DE_SQ2 LALT(KC_2) // ² | ||
| 89 | #define DE_SQ3 LALT(KC_3) // ³ | ||
| 90 | #define DE_LCBR LALT(KC_7) // { | ||
| 91 | #define DE_LBRC LALT(KC_5) // [ | ||
| 92 | #define DE_RBRC LALT(KC_6) // ] | ||
| 93 | #define DE_RCBR LALT(KC_9) // } | ||
| 94 | #define DE_BSLS LALT(LSFT(KC_7)) // backslash | ||
| 95 | #define DE_AT LALT(DE_L) // @ | ||
| 96 | #define DE_EURO LALT(KC_E) // € | ||
| 97 | #define DE_TILD LALT(DE_N) // ~ | ||
| 98 | #define DE_PIPE LALT(DE_7) // | | ||
| 99 | |||
| 100 | #endif | ||
