From 6a2187d621302130cd5e2baf45c37bc9264d220d Mon Sep 17 00:00:00 2001 From: Xelus22 <> Date: Sat, 14 Dec 2024 14:26:30 +1100 Subject: [PATCH] add encodermap --- keyboards/swagkeys/integral/keyboard.json | 5 +++-- keyboards/swagkeys/integral/keymaps/default/keymap.c | 7 +++++++ keyboards/swagkeys/integral/keymaps/default/rules.mk | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 keyboards/swagkeys/integral/keymaps/default/rules.mk diff --git a/keyboards/swagkeys/integral/keyboard.json b/keyboards/swagkeys/integral/keyboard.json index a482834ac481..0a2cb3b3bb16 100644 --- a/keyboards/swagkeys/integral/keyboard.json +++ b/keyboards/swagkeys/integral/keyboard.json @@ -5,8 +5,9 @@ "bootloader": "stm32duino", "diode_direction": "COL2ROW", "encoder": { - "pin_a": "B8", - "pin_b": "B9" + "rotary": [ + {"pin_a": "B8", "pin_b": "B9"} + ] }, "features": { "bootmagic": true, diff --git a/keyboards/swagkeys/integral/keymaps/default/keymap.c b/keyboards/swagkeys/integral/keymaps/default/keymap.c index dda9c0cb5732..b586986e22a1 100644 --- a/keyboards/swagkeys/integral/keymaps/default/keymap.c +++ b/keyboards/swagkeys/integral/keymaps/default/keymap.c @@ -33,3 +33,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(KC_PGDN, KC_PGUP) } +}; +#endif diff --git a/keyboards/swagkeys/integral/keymaps/default/rules.mk b/keyboards/swagkeys/integral/keymaps/default/rules.mk new file mode 100644 index 000000000000..ee325681483f --- /dev/null +++ b/keyboards/swagkeys/integral/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes