diff options
author | fauxpark <fauxpark@gmail.com> | 2019-07-16 16:04:02 +1000 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-07-15 23:04:02 -0700 |
commit | f14629ed1cd7c7ec9089604d64f29a99981558e8 (patch) | |
tree | a3691f4f3cb0c941694c16a3a94f73befb6ef6ec /keyboards/chimera_ergo/keymaps | |
parent | 2a231457bd494079c36cf3e07c9b887016adb491 (diff) |
Remove/migrate action_get_macro()s from default keymaps (#5625)
* Remove/migrate action_get_macro()s from default keymaps
* Leave these breaks alone
Diffstat (limited to 'keyboards/chimera_ergo/keymaps')
-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 0b60b1dafa..51ab0e92cd 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 _NAV }; +enum custom_keycodes { + SC_INCL = SAFE_RANGE, + SC_PULL, + SC_PUSH, + SC_SCAP, + SC_SCOF +}; + #define SC_NMPD TG(_NUMPAD) #define SC_SYMB TG(_SYMBOLS) #define SC_SPFN LT(_NAV,KC_EQL) @@ -26,11 +34,6 @@ enum chimera_ergo_layers #define SC_SPRT MT(MOD_LALT, KC_1) #define SC_GBRC MT(MOD_RGUI, KC_RBRC) #define SC_MESC LT(_MACROS, KC_ESC) -#define SC_INCL M(0) -#define SC_PULL M(1) -#define SC_PUSH M(2) -#define SC_SCAP M(3) -#define SC_SCOF M(4) #define SC_CAD LALT(LCTL(KC_DEL)) #define LONGPRESS_DELAY 150 @@ -88,47 +91,45 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { /* include some kind of library or header */ - case 0: + case SC_INCL: if (record->event.pressed) { SEND_STRING("#include <>"); - return MACRO( T(LEFT), END); + tap_code(KC_LEFT); } - break; - case 1: + return false; + case SC_PULL: if (record->event.pressed) { SEND_STRING("git pull"); - return MACRO( T(ENT), END ); + tap_code(KC_ENT); } - break; - case 2: - if (record->event.pressed){ + return false; + case SC_PUSH: + if (record->event.pressed) { SEND_STRING("git push"); - return MACRO( T(ENT), END ); + tap_code(KC_ENT); } - break; - case 3: - if (record->event.pressed){ + return false; + case SC_SCAP: + if (record->event.pressed) { layer_on(_CAPS); - register_code(KC_CAPSLOCK); - unregister_code(KC_CAPSLOCK); + tap_code(KC_CAPS); } - break; - case 4: - if (record->event.pressed){ + return false; + case SC_SCOF: + if (record->event.pressed) { layer_off(_CAPS); - register_code(KC_CAPSLOCK); - unregister_code(KC_CAPSLOCK); + tap_code(KC_CAPS); } - break; + return false; + default: + return true; } - return MACRO_NONE; + return true; }; - void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); |