summaryrefslogtreecommitdiff
path: root/keyboards/dmqdesign/spin/keymaps
diff options
context:
space:
mode:
authorJoshua Diamond <josh@windowoffire.com>2022-08-28 13:10:28 -0400
committerGitHub <noreply@github.com>2022-08-28 10:10:28 -0700
commit37a85e1f9b5d6ad28e52b800f1b17d68ee5e4892 (patch)
tree292c6e4525523d125ed99c8b7b5b29b18c2a4667 /keyboards/dmqdesign/spin/keymaps
parentef0c87c976ff298f2e34e417808ed816f7ecb0b5 (diff)
downloadqmk_firmware-37a85e1f9b5d6ad28e52b800f1b17d68ee5e4892.tar.gz
qmk_firmware-37a85e1f9b5d6ad28e52b800f1b17d68ee5e4892.zip
More spidey3 userspace cleanup (#18049)
Diffstat (limited to 'keyboards/dmqdesign/spin/keymaps')
-rw-r--r--keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h2
-rw-r--r--keyboards/dmqdesign/spin/keymaps/spidey3_pad/keymap.c64
-rw-r--r--keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk6
3 files changed, 29 insertions, 43 deletions
diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h
index 1851f07f1d..b9a0b53fbf 100644
--- a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h
+++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/config.h
@@ -24,7 +24,7 @@
#undef LOCKING_SUPPORT_ENABLE
#define LAYER_STATE_8BIT
-#define MAX_LAYER 4
+#define MAX_LAYER 5
#undef RGBLIGHT_ANIMATIONS
#define RGBLIGHT_EFFECT_BREATHING
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;
-}
diff --git a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk
index 7fe1f992aa..5d543e2c7e 100644
--- a/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk
+++ b/keyboards/dmqdesign/spin/keymaps/spidey3_pad/rules.mk
@@ -1,7 +1,7 @@
MOUSEKEY_ENABLE = no
MIDI_ENABLE = no
-BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
+BOOTMAGIC_ENABLE = yes
LTO_ENABLE = yes
-CONSOLE_ENABLE = yes # Console for debug
+CONSOLE_ENABLE = yes
GRAVE_ESC_ENABLE = no
-
+ENCODER_MAP_ENABLE = yes