diff options
author | Joshua Diamond <josh@windowoffire.com> | 2022-08-28 13:10:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-28 10:10:28 -0700 |
commit | 37a85e1f9b5d6ad28e52b800f1b17d68ee5e4892 (patch) | |
tree | 292c6e4525523d125ed99c8b7b5b29b18c2a4667 /keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c | |
parent | ef0c87c976ff298f2e34e417808ed816f7ecb0b5 (diff) |
More spidey3 userspace cleanup (#18049)
Diffstat (limited to 'keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c')
-rw-r--r-- | keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c | 64 |
1 files changed, 25 insertions, 39 deletions
diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c index 58aa5554c2..8c9af7202b 100644 --- a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c +++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c @@ -61,11 +61,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RGB_RMOD, RGB_TOG, RGB_MOD), [_FN] = LAYOUT( - KC_TRNS, DEBUG, QK_BOOT, KC_TRNS, + KC_NO, DEBUG, QK_BOOT, KC_TRNS, KC_NO, KC_NO, EEP_RST, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_NO, KC_NO), + KC_TRNS, KC_NO, KC_NO), }; + +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_MACRO] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_NUMPAD] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_CURSOR] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_RGB] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI ), ENCODER_CCW_CW(RGB_SAD, RGB_SAI ), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [_FN] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, +}; + // clang-format on typedef enum layer_ack { @@ -153,9 +162,22 @@ void spidey_glow(void) { rgblight_sethsv(255, 230, 128); } -void eeconfig_init_user(void) { spidey_glow(); } +void eeconfig_init_user(void) { + spidey_glow(); +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { + dprintf("key event: kc: %02X, col: %02u, row: %02u, pressed: %u mods: %08b " +#if !defined(NO_ACTION_ONESHOT) + "os: %08b " +#endif + "weak: %08b\n", + keycode, record->event.key.col, record->event.key.row, record->event.pressed, bitrev(get_mods()), +#if !defined(NO_ACTION_ONESHOT) + bitrev(get_oneshot_mods()), +#endif + bitrev(get_weak_mods())); + if (record->event.pressed) { switch (keycode) { // Re-implement this here, but fix the persistence! @@ -208,39 +230,3 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) { } } -bool encoder_update_user(uint8_t index, bool clockwise) { - switch (get_highest_layer(layer_state)) { - case _RGB: - if (index == 0) { - if (clockwise) { - rgblight_increase_hue(); - } else { - rgblight_decrease_hue(); - } - } else if (index == 1) { - if (clockwise) { - rgblight_increase_sat(); - } else { - rgblight_decrease_sat(); - } - } else if (index == 2) { - if (clockwise) { - rgblight_increase_val(); - } else { - rgblight_decrease_val(); - } - } - break; - - default: - if (index == 0) { - tap_code16(C(S(clockwise ? KC_EQL : KC_MINS))); - } else if (index == 1) { - tap_code16(C(clockwise ? KC_EQL : KC_MINS)); - } else if (index == 2) { - tap_code(clockwise ? KC_VOLU : KC_VOLD); - } - break; - } - return true; -} |