From 0da6562c4df570729889690e21061229c5648b73 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 18 Jun 2022 14:37:51 -0700 Subject: Make default layer size 16-bit (#15286) Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> --- layouts/community/ergodox/dvorak_spanish/keymap.c | 43 +++++++++++------------ 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'layouts/community/ergodox/dvorak_spanish/keymap.c') diff --git a/layouts/community/ergodox/dvorak_spanish/keymap.c b/layouts/community/ergodox/dvorak_spanish/keymap.c index 98aa638a0f..805abb0b77 100644 --- a/layouts/community/ergodox/dvorak_spanish/keymap.c +++ b/layouts/community/ergodox/dvorak_spanish/keymap.c @@ -192,13 +192,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { key_timer = timer_read(); register_code(KC_RSFT); - } else { + } else { unregister_code(KC_RSFT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_BSLS); - unregister_code(KC_BSLS); - unregister_code(KC_RALT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_BSLS); + unregister_code(KC_BSLS); + unregister_code(KC_RALT); } } break; @@ -207,13 +207,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { key_timer = timer_read(); register_code(KC_LALT); - } else { + } else { unregister_code(KC_LALT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_LBRACKET); - unregister_code(KC_LBRACKET); - unregister_code(KC_RALT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_LBRACKET); + unregister_code(KC_LBRACKET); + unregister_code(KC_RALT); } } break; @@ -222,13 +222,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { key_timer = timer_read(); register_code(KC_LALT); - } else { + } else { unregister_code(KC_LALT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_RBRACKET); - unregister_code(KC_RBRACKET); - unregister_code(KC_RALT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_RBRACKET); + unregister_code(KC_RBRACKET); + unregister_code(KC_RALT); } } break; @@ -236,7 +236,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case CAPS: { if (record->event.pressed) { register_code(KC_CAPSLOCK); - } else { + } else { unregister_code(KC_CAPSLOCK); } break; @@ -253,7 +253,7 @@ void matrix_init_user(void) { // Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); + uint8_t layer = get_highest_layer(layer_state); ergodox_board_led_off(); ergodox_right_led_1_off(); @@ -270,11 +270,10 @@ void matrix_scan_user(void) { // none break; } - + // Turn the caps lock led on if (host_keyboard_leds() & (1<