From f14629ed1cd7c7ec9089604d64f29a99981558e8 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 16 Jul 2019 16:04:02 +1000 Subject: Remove/migrate action_get_macro()s from default keymaps (#5625) * Remove/migrate action_get_macro()s from default keymaps * Leave these breaks alone --- keyboards/satan/keymaps/isoHHKB/keymap.c | 34 +++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'keyboards/satan/keymaps/isoHHKB') diff --git a/keyboards/satan/keymaps/isoHHKB/keymap.c b/keyboards/satan/keymaps/isoHHKB/keymap.c index 701095907e..46d66e5db6 100644 --- a/keyboards/satan/keymaps/isoHHKB/keymap.c +++ b/keyboards/satan/keymaps/isoHHKB/keymap.c @@ -10,8 +10,10 @@ #define _BL 0 #define _FL 1 -#define KC_ENYE M(0) -#define KC_CEDL M(1) +enum custom_keycodes { + KC_ENYE = SAFE_RANGE, + KC_CEDL +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer @@ -93,14 +95,28 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { - switch(id) { - case 0: // Ñ - return MACRO(D(LALT), T(KP_0), T(KP_2), T(KP_4), T(KP_1), U(LALT), END); - case 1: // Ç - return MACRO(D(LALT), T(KP_0), T(KP_2), T(KP_3), T(KP_1), U(LALT), END); + switch(keycode) { + case KC_ENYE: // Ñ + register_code16(KC_LALT); + tap_code(KC_KP_0); + tap_code(KC_KP_2); + tap_code(KC_KP_4); + tap_code(KC_KP_1); + unregister_code16(KC_LALT); + return false; + case KC_CEDL: // Ç + register_code16(KC_LALT); + tap_code(KC_KP_0); + tap_code(KC_KP_2); + tap_code(KC_KP_3); + tap_code(KC_KP_1); + unregister_code16(KC_LALT); + return false; + default: + return true; } } - return MACRO_NONE; + return true; }; -- cgit v1.2.3