aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Weldon <matthew.john.weldon@gmail.com>2020-07-23 22:42:56 -0400
committerGitHub <noreply@github.com>2020-07-23 19:42:56 -0700
commite620a7beb2beebee3881f7061eac218beb668e26 (patch)
treec6d1c00597896828520cd76ad5a168e6cd17f27b
parentd699fd1fb4127c9a0c13eaa1348b934ccd639627 (diff)
downloadqmk_firmware-e620a7beb2beebee3881f7061eac218beb668e26.tar.gz
qmk_firmware-e620a7beb2beebee3881f7061eac218beb668e26.zip
[Keyboard] add encoder support to PlaidPad default mappings (#9396)
* Add flipped and discrete encoder support default mappings * Fixed typo in readme * Removed flipped layout, fix config.h encoder pin mapping, update readme Co-authored-by: matt <matt@smooth.tech>
-rw-r--r--keyboards/keycapsss/plaid_pad/config.h6
-rw-r--r--keyboards/keycapsss/plaid_pad/keymaps/default/keymap.c4
-rw-r--r--keyboards/keycapsss/plaid_pad/keymaps/default/readme.md8
3 files changed, 11 insertions, 7 deletions
diff --git a/keyboards/keycapsss/plaid_pad/config.h b/keyboards/keycapsss/plaid_pad/config.h
index 1d0b31a40..f456bf844 100644
--- a/keyboards/keycapsss/plaid_pad/config.h
+++ b/keyboards/keycapsss/plaid_pad/config.h
@@ -18,8 +18,10 @@
18#define MATRIX_COL_PINS { B0, D7, D6, D5 } 18#define MATRIX_COL_PINS { B0, D7, D6, D5 }
19#define UNUSED_PINS { B3, B4, B5, D4} 19#define UNUSED_PINS { B3, B4, B5, D4}
20 20
21#define ENCODERS_PAD_A { D0, B1 } 21#define ENCODERS_PAD_A { D1, B2 }
22#define ENCODERS_PAD_B { D1, B2 } 22#define ENCODERS_PAD_B { D0, B1 }
23
24
23#define ENCODER_RESOLUTION 4 25#define ENCODER_RESOLUTION 4
24 26
25/* COL2ROW, ROW2COL*/ 27/* COL2ROW, ROW2COL*/
diff --git a/keyboards/keycapsss/plaid_pad/keymaps/default/keymap.c b/keyboards/keycapsss/plaid_pad/keymaps/default/keymap.c
index bdfd7fb78..7de3be5bd 100644
--- a/keyboards/keycapsss/plaid_pad/keymaps/default/keymap.c
+++ b/keyboards/keycapsss/plaid_pad/keymaps/default/keymap.c
@@ -30,9 +30,9 @@ void keyboard_post_init_user(void) {
30void encoder_update_user(uint8_t index, bool clockwise) { 30void encoder_update_user(uint8_t index, bool clockwise) {
31 if (index == 0) { // First encoder - top left 31 if (index == 0) { // First encoder - top left
32 if (clockwise) { 32 if (clockwise) {
33 tap_code(KC_UP); 33 tap_code(KC_RIGHT);
34 } else { 34 } else {
35 tap_code(KC_DOWN); 35 tap_code(KC_LEFT);
36 } 36 }
37 } else if (index == 1) { // Second encoder - top right 37 } else if (index == 1) { // Second encoder - top right
38 if (clockwise) { 38 if (clockwise) {
diff --git a/keyboards/keycapsss/plaid_pad/keymaps/default/readme.md b/keyboards/keycapsss/plaid_pad/keymaps/default/readme.md
index 1c1b1513d..ccbea5f86 100644
--- a/keyboards/keycapsss/plaid_pad/keymaps/default/readme.md
+++ b/keyboards/keycapsss/plaid_pad/keymaps/default/readme.md
@@ -3,9 +3,11 @@
3 3
4# Default Plaid-Pad Layout 4# Default Plaid-Pad Layout
5 5
6This is the default layout that comes flashed on every Plaid-Pad. 6This is the default layout for the plaid pad.
7The upper left (7) and right (/) switch, can be replaced by a rotary encoder. 7The upper left (7) and right (/) switch, can be replaced by a rotary encoder.
8They do "Up Arrow" (KC_UP) and "Down Arrow" (KC_DOWN). 8Encoders with built-in switch are supported and map to the original keys (7) and (/).
9Encoder with build-in switch are supported.
10 9
10The upper left encoder performs a tap on "Right Arrow" (KC_RIGHT) and "Left Arrow" (KC_LEFT) when rotated clockwise and counter-clockwise in the respective direction for each step of the encoder.
11
12The upper right encoder performs a tap on "Up Arrow" (KC_UP) and "Down Arrow" (KC_DOWN) when rotated clockwise and counter-clockwise in the respective direction for each step of the encoder.
11 13