diff options
Diffstat (limited to 'keyboards/chimera_ergo/keymaps/default/keymap.c')
-rw-r--r-- | keyboards/chimera_ergo/keymaps/default/keymap.c | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/keyboards/chimera_ergo/keymaps/default/keymap.c b/keyboards/chimera_ergo/keymaps/default/keymap.c index 0b60b1daf..51ab0e92c 100644 --- a/keyboards/chimera_ergo/keymaps/default/keymap.c +++ b/keyboards/chimera_ergo/keymaps/default/keymap.c | |||
@@ -17,6 +17,14 @@ enum chimera_ergo_layers | |||
17 | _NAV | 17 | _NAV |
18 | }; | 18 | }; |
19 | 19 | ||
20 | enum custom_keycodes { | ||
21 | SC_INCL = SAFE_RANGE, | ||
22 | SC_PULL, | ||
23 | SC_PUSH, | ||
24 | SC_SCAP, | ||
25 | SC_SCOF | ||
26 | }; | ||
27 | |||
20 | #define SC_NMPD TG(_NUMPAD) | 28 | #define SC_NMPD TG(_NUMPAD) |
21 | #define SC_SYMB TG(_SYMBOLS) | 29 | #define SC_SYMB TG(_SYMBOLS) |
22 | #define SC_SPFN LT(_NAV,KC_EQL) | 30 | #define SC_SPFN LT(_NAV,KC_EQL) |
@@ -26,11 +34,6 @@ enum chimera_ergo_layers | |||
26 | #define SC_SPRT MT(MOD_LALT, KC_1) | 34 | #define SC_SPRT MT(MOD_LALT, KC_1) |
27 | #define SC_GBRC MT(MOD_RGUI, KC_RBRC) | 35 | #define SC_GBRC MT(MOD_RGUI, KC_RBRC) |
28 | #define SC_MESC LT(_MACROS, KC_ESC) | 36 | #define SC_MESC LT(_MACROS, KC_ESC) |
29 | #define SC_INCL M(0) | ||
30 | #define SC_PULL M(1) | ||
31 | #define SC_PUSH M(2) | ||
32 | #define SC_SCAP M(3) | ||
33 | #define SC_SCOF M(4) | ||
34 | #define SC_CAD LALT(LCTL(KC_DEL)) | 37 | #define SC_CAD LALT(LCTL(KC_DEL)) |
35 | 38 | ||
36 | #define LONGPRESS_DELAY 150 | 39 | #define LONGPRESS_DELAY 150 |
@@ -88,47 +91,45 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
88 | 91 | ||
89 | }; | 92 | }; |
90 | 93 | ||
91 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | 94 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
92 | { | 95 | switch(keycode) { |
93 | switch(id) { | ||
94 | /* include some kind of library or header */ | 96 | /* include some kind of library or header */ |
95 | case 0: | 97 | case SC_INCL: |
96 | if (record->event.pressed) { | 98 | if (record->event.pressed) { |
97 | SEND_STRING("#include <>"); | 99 | SEND_STRING("#include <>"); |
98 | return MACRO( T(LEFT), END); | 100 | tap_code(KC_LEFT); |
99 | } | 101 | } |
100 | break; | 102 | return false; |
101 | case 1: | 103 | case SC_PULL: |
102 | if (record->event.pressed) { | 104 | if (record->event.pressed) { |
103 | SEND_STRING("git pull"); | 105 | SEND_STRING("git pull"); |
104 | return MACRO( T(ENT), END ); | 106 | tap_code(KC_ENT); |
105 | } | 107 | } |
106 | break; | 108 | return false; |
107 | case 2: | 109 | case SC_PUSH: |
108 | if (record->event.pressed){ | 110 | if (record->event.pressed) { |
109 | SEND_STRING("git push"); | 111 | SEND_STRING("git push"); |
110 | return MACRO( T(ENT), END ); | 112 | tap_code(KC_ENT); |
111 | } | 113 | } |
112 | break; | 114 | return false; |
113 | case 3: | 115 | case SC_SCAP: |
114 | if (record->event.pressed){ | 116 | if (record->event.pressed) { |
115 | layer_on(_CAPS); | 117 | layer_on(_CAPS); |
116 | register_code(KC_CAPSLOCK); | 118 | tap_code(KC_CAPS); |
117 | unregister_code(KC_CAPSLOCK); | ||
118 | } | 119 | } |
119 | break; | 120 | return false; |
120 | case 4: | 121 | case SC_SCOF: |
121 | if (record->event.pressed){ | 122 | if (record->event.pressed) { |
122 | layer_off(_CAPS); | 123 | layer_off(_CAPS); |
123 | register_code(KC_CAPSLOCK); | 124 | tap_code(KC_CAPS); |
124 | unregister_code(KC_CAPSLOCK); | ||
125 | } | 125 | } |
126 | break; | 126 | return false; |
127 | default: | ||
128 | return true; | ||
127 | } | 129 | } |
128 | return MACRO_NONE; | 130 | return true; |
129 | }; | 131 | }; |
130 | 132 | ||
131 | |||
132 | void matrix_scan_user(void) { | 133 | void matrix_scan_user(void) { |
133 | uint8_t layer = biton32(layer_state); | 134 | uint8_t layer = biton32(layer_state); |
134 | 135 | ||