diff options
-rw-r--r-- | layouts/community/ortho_4x12/jotix/keymap.c | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/layouts/community/ortho_4x12/jotix/keymap.c b/layouts/community/ortho_4x12/jotix/keymap.c index 09543090d..d28be78e5 100644 --- a/layouts/community/ortho_4x12/jotix/keymap.c +++ b/layouts/community/ortho_4x12/jotix/keymap.c | |||
@@ -4,16 +4,13 @@ enum layers { | |||
4 | _QWERTY, | 4 | _QWERTY, |
5 | _LOWER, | 5 | _LOWER, |
6 | _RAISE, | 6 | _RAISE, |
7 | _ADJUST | ||
7 | }; | 8 | }; |
8 | 9 | ||
9 | #define LOWER MO(_LOWER) | 10 | #define LOWER MO(_LOWER) |
10 | #define RAISE MO(_RAISE) | 11 | #define RAISE MO(_RAISE) |
11 | #define TGLOWER TG(_LOWER) | 12 | #define TGLOWER TG(_LOWER) |
12 | 13 | ||
13 | static bool is_ctl_pressed; | ||
14 | static bool is_esc_pressed; | ||
15 | static bool is_bspc_pressed; | ||
16 | |||
17 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 14 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
18 | 15 | ||
19 | [_QWERTY] = LAYOUT_ortho_4x12 ( | 16 | [_QWERTY] = LAYOUT_ortho_4x12 ( |
@@ -52,46 +49,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
52 | // └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ | 49 | // └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ |
53 | ), | 50 | ), |
54 | 51 | ||
52 | [_ADJUST] = LAYOUT_ortho_4x12 ( | ||
53 | // ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐ | ||
54 | _______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, | ||
55 | // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ | ||
56 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, | ||
57 | // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ | ||
58 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, | ||
59 | // ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤ | ||
60 | _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ | ||
61 | // └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ | ||
62 | ), | ||
63 | |||
55 | }; | 64 | }; |
56 | 65 | ||
57 | layer_state_t layer_state_set_user(layer_state_t state) { | 66 | layer_state_t layer_state_set_user(layer_state_t state) { |
58 | #ifdef JOTANCK_LEDS | 67 | #ifdef JOTANCK_LEDS |
59 | writePin(JOTANCK_LED1, (get_highest_layer(state) == _LOWER)); | 68 | writePin(JOTANCK_LED1, (get_highest_layer(state) == _LOWER)); |
60 | #endif | 69 | #endif |
61 | return state; | 70 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); |
62 | } | 71 | } |
63 | 72 | ||
64 | bool led_update_user(led_t led_state) { | 73 | bool led_update_user(led_t led_state) { |
65 | |||
66 | // NumLock allways on | 74 | // NumLock allways on |
67 | if (!led_state.num_lock) { | 75 | if (!led_state.num_lock) { |
68 | tap_code(KC_NUMLOCK); | 76 | tap_code(KC_NUMLOCK); |
69 | } | 77 | } |
70 | |||
71 | #ifdef JOTANCK_LEDS | 78 | #ifdef JOTANCK_LEDS |
72 | // CapsLock led | 79 | // CapsLock led |
73 | writePin(JOTANCK_LED2, led_state.caps_lock); | 80 | writePin(JOTANCK_LED2, led_state.caps_lock); |
74 | #endif | 81 | #endif |
75 | return true; | 82 | return true; |
76 | } | 83 | } \ No newline at end of file |
77 | |||
78 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
79 | switch (keycode) { | ||
80 | case KC_LCTL: | ||
81 | is_ctl_pressed = record->event.pressed; | ||
82 | break; | ||
83 | case KC_ESC: | ||
84 | is_esc_pressed = record->event.pressed; | ||
85 | break; | ||
86 | case KC_BSPC: | ||
87 | is_bspc_pressed = record->event.pressed; | ||
88 | break; | ||
89 | }; | ||
90 | return true; | ||
91 | } | ||
92 | |||
93 | void matrix_scan_user(void) { | ||
94 | if (is_ctl_pressed && is_esc_pressed && is_bspc_pressed) { | ||
95 | reset_keyboard(); | ||
96 | } | ||
97 | } | ||