diff options
author | Drashna Jaelre <drashna@live.com> | 2022-12-31 16:57:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-01 11:57:15 +1100 |
commit | b4d5c22ed4731abdd89eec373b922da7c7dbff7c (patch) | |
tree | 01db55feeb1567b211ab8a78ae5e6a0f06d88443 /keyboards/work_louder/micro/keymaps | |
parent | 2ae215514a110f053b161420ec75d9f7953000d1 (diff) |
Keyboard/fix work louder micro (#18968)
Diffstat (limited to 'keyboards/work_louder/micro/keymaps')
-rw-r--r-- | keyboards/work_louder/micro/keymaps/via/keymap.c | 63 | ||||
-rw-r--r-- | keyboards/work_louder/micro/keymaps/via/rules.mk | 4 |
2 files changed, 39 insertions, 28 deletions
diff --git a/keyboards/work_louder/micro/keymaps/via/keymap.c b/keyboards/work_louder/micro/keymaps/via/keymap.c index da910af6b2..d4be308b2a 100644 --- a/keyboards/work_louder/micro/keymaps/via/keymap.c +++ b/keyboards/work_louder/micro/keymaps/via/keymap.c @@ -4,30 +4,29 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT( - KC_MPLY, KC_9, KC_0, KC_NO, - KC_5, KC_6, KC_7, KC_8, - KC_1, KC_2, KC_3, KC_4, - TO(1), KC_DOT, KC_COMM, USER09 + [0] = LAYOUT( + KC_MPLY, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_TOG, XXXXXXX, XXXXXXX, 0x5011 ), - LAYOUT( - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______, - TO(2), _______, _______, _______ - + [1] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, 0x5012 ), - LAYOUT( - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______, - TO(3), _______, _______, _______ + [2] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, 0x5013 ), - LAYOUT( - _______, _______, _______, _______, - _______, _______, _______, _______, - _______, _______, _______, _______, - TO(0), _______, _______, _______ + [3] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + USER00, USER01, USER03, USER05, + XXXXXXX, USER02, USER04, USER06, + XXXXXXX, XXXXXXX, XXXXXXX, 0x5010 ) }; @@ -51,22 +50,28 @@ typedef union { work_louder_config_t work_louder_config; bool process_record_user(uint16_t keycode, keyrecord_t *record) { -#ifdef CONSOLE_ENABLE - uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %b, time: %5u, int: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); -#endif - switch (keycode) { case USER09: if (record->event.pressed) { work_louder_config.led_level++; if (work_louder_config.led_level > 4) { - work_louder_config.led_level = 0; + work_louder_config.led_level = 1; } work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4)); eeconfig_update_user(work_louder_config.raw); layer_state_set_kb(layer_state); } break; + case 0x5000 ... 0x500F: + if (record->event.pressed) { + layer_move(keycode - 0x5000); + } + return false; break; + case 0x5010 ... 0x501F: + if (record->event.pressed) { + layer_move(keycode - 0x5010); + } + return false; break; } return true; } @@ -86,7 +91,11 @@ void eeconfig_init_user(void) { eeconfig_update_user(work_louder_config.raw); } -void matrix_init_user(void) { +void keyboard_post_init_user(void) { work_louder_config.raw = eeconfig_read_user(); work_louder_micro_led_all_set((uint8_t)(work_louder_config.led_level * 255 / 4)); } + +void suspend_wakeup_init_user(void) { + layer_state_set_user(layer_state); +} diff --git a/keyboards/work_louder/micro/keymaps/via/rules.mk b/keyboards/work_louder/micro/keymaps/via/rules.mk index f1adcab005..a067e071fe 100644 --- a/keyboards/work_louder/micro/keymaps/via/rules.mk +++ b/keyboards/work_louder/micro/keymaps/via/rules.mk @@ -1,2 +1,4 @@ -VIA_ENABLE = yes +VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes +MAGIC_ENABLE = no +SPACE_CADET_ENABLE = no |