diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-05-21 23:17:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-21 23:17:32 -0700 |
| commit | a0fed0ea176d1c986e40fc4981b900509c90d66e (patch) | |
| tree | ee12f5943046015ea0dce8e2a30a68bc8eb99dbe /keyboards/handwired | |
| parent | 76c23b15abc824f867b48d8d5100dced2417d336 (diff) | |
| download | qmk_firmware-a0fed0ea176d1c986e40fc4981b900509c90d66e.tar.gz qmk_firmware-a0fed0ea176d1c986e40fc4981b900509c90d66e.zip | |
Convert Encoder callbacks to be boolean functions (#12805)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'keyboards/handwired')
20 files changed, 70 insertions, 54 deletions
diff --git a/keyboards/handwired/amigopunk/keymaps/default/keymap.c b/keyboards/handwired/amigopunk/keymaps/default/keymap.c index 7aed2a61c..70c6e7725 100644 --- a/keyboards/handwired/amigopunk/keymaps/default/keymap.c +++ b/keyboards/handwired/amigopunk/keymaps/default/keymap.c | |||
| @@ -37,11 +37,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | #ifdef ENCODER_ENABLE | 39 | #ifdef ENCODER_ENABLE |
| 40 | void encoder_update_user(uint8_t index, bool clockwise) { | 40 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 41 | if (index != 0) | 41 | if (index != 0) |
| 42 | return; | 42 | return; |
| 43 | 43 | ||
| 44 | tap_code(clockwise ? KC_VOLU : KC_VOLD); | 44 | tap_code(clockwise ? KC_VOLU : KC_VOLD); |
| 45 | return true; | ||
| 45 | } | 46 | } |
| 46 | #endif | 47 | #endif |
| 47 | 48 | ||
diff --git a/keyboards/handwired/bento/keymaps/cbc02009/keymap.c b/keyboards/handwired/bento/keymaps/cbc02009/keymap.c index 169e0f1dd..57c107b9f 100644 --- a/keyboards/handwired/bento/keymaps/cbc02009/keymap.c +++ b/keyboards/handwired/bento/keymaps/cbc02009/keymap.c | |||
| @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 29 | 29 | ||
| 30 | #ifdef ENCODER_ENABLE | 30 | #ifdef ENCODER_ENABLE |
| 31 | #include "encoder.h" | 31 | #include "encoder.h" |
| 32 | void encoder_update_user(int8_t index, bool clockwise) { | 32 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 33 | if (index == 0) { /* First encoder */ | 33 | if (index == 0) { /* First encoder */ |
| 34 | if (clockwise) { | 34 | if (clockwise) { |
| 35 | tap_code(KC_VOLU); | 35 | tap_code(KC_VOLU); |
| @@ -37,5 +37,6 @@ void encoder_update_user(int8_t index, bool clockwise) { | |||
| 37 | tap_code(KC_VOLD); | 37 | tap_code(KC_VOLD); |
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | return true; | ||
| 40 | } | 41 | } |
| 41 | #endif | 42 | #endif |
diff --git a/keyboards/handwired/bento/keymaps/default/keymap.c b/keyboards/handwired/bento/keymaps/default/keymap.c index 6a2cfa682..dc074c420 100644 --- a/keyboards/handwired/bento/keymaps/default/keymap.c +++ b/keyboards/handwired/bento/keymaps/default/keymap.c | |||
| @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 39 | ), | 39 | ), |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | void encoder_update_user(uint8_t index, bool clockwise) { | 42 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 43 | if (index == _ENCODER) { | 43 | if (index == _ENCODER) { |
| 44 | if (clockwise) { | 44 | if (clockwise) { |
| 45 | tap_code(KC_VOLU); | 45 | tap_code(KC_VOLU); |
| @@ -47,4 +47,5 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 47 | tap_code(KC_VOLD); | 47 | tap_code(KC_VOLD); |
| 48 | } | 48 | } |
| 49 | } | 49 | } |
| 50 | return true; | ||
| 50 | } | 51 | } |
diff --git a/keyboards/handwired/bento/keymaps/mac/keymap.c b/keyboards/handwired/bento/keymaps/mac/keymap.c index 29a7e809f..bb584c9a5 100644 --- a/keyboards/handwired/bento/keymaps/mac/keymap.c +++ b/keyboards/handwired/bento/keymaps/mac/keymap.c | |||
| @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | 43 | ||
| 44 | void encoder_update_user(uint8_t index, bool clockwise) { | 44 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 45 | if (index == _ENCODER) { | 45 | if (index == _ENCODER) { |
| 46 | if (clockwise) { | 46 | if (clockwise) { |
| 47 | tap_code(KC_VOLU); | 47 | tap_code(KC_VOLU); |
| @@ -49,6 +49,5 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 49 | tap_code(KC_VOLD); | 49 | tap_code(KC_VOLD); |
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| 52 | return true; | ||
| 52 | } | 53 | } |
| 53 | |||
| 54 | |||
diff --git a/keyboards/handwired/d48/keymaps/anderson/keymap.c b/keyboards/handwired/d48/keymaps/anderson/keymap.c index 25837a359..f63bf54ea 100644 --- a/keyboards/handwired/d48/keymaps/anderson/keymap.c +++ b/keyboards/handwired/d48/keymaps/anderson/keymap.c | |||
| @@ -229,7 +229,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { | |||
| 229 | return state; | 229 | return state; |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | void encoder_update_user(uint8_t index, bool clockwise) { | 232 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 233 | if (index == 0) { | 233 | if (index == 0) { |
| 234 | if (!alpha_pressed) { | 234 | if (!alpha_pressed) { |
| 235 | tap_code(clockwise ? KC_VOLD : KC_VOLU); | 235 | tap_code(clockwise ? KC_VOLD : KC_VOLU); |
| @@ -243,6 +243,7 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 243 | tap_code(clockwise ? KC_PGUP : KC_PGDN); | 243 | tap_code(clockwise ? KC_PGUP : KC_PGDN); |
| 244 | } | 244 | } |
| 245 | } | 245 | } |
| 246 | return true; | ||
| 246 | } | 247 | } |
| 247 | 248 | ||
| 248 | #ifdef OLED_DRIVER_ENABLE | 249 | #ifdef OLED_DRIVER_ENABLE |
diff --git a/keyboards/handwired/d48/keymaps/default/keymap.c b/keyboards/handwired/d48/keymaps/default/keymap.c index b7914f3bc..08bb90603 100644 --- a/keyboards/handwired/d48/keymaps/default/keymap.c +++ b/keyboards/handwired/d48/keymaps/default/keymap.c | |||
| @@ -174,7 +174,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 174 | return taphold_process(keycode, record); | 174 | return taphold_process(keycode, record); |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | void encoder_update_user(uint8_t index, bool clockwise) { | 177 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 178 | if (index == 0) { | 178 | if (index == 0) { |
| 179 | if (!alpha_pressed) { | 179 | if (!alpha_pressed) { |
| 180 | tap_code(clockwise ? KC_VOLD : KC_VOLU); | 180 | tap_code(clockwise ? KC_VOLD : KC_VOLU); |
| @@ -188,6 +188,7 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 188 | tap_code(clockwise ? KC_PGUP : KC_PGDN); | 188 | tap_code(clockwise ? KC_PGUP : KC_PGDN); |
| 189 | } | 189 | } |
| 190 | } | 190 | } |
| 191 | return true; | ||
| 191 | } | 192 | } |
| 192 | 193 | ||
| 193 | #ifdef OLED_DRIVER_ENABLE | 194 | #ifdef OLED_DRIVER_ENABLE |
diff --git a/keyboards/handwired/dactyl_manuform/5x6_5/keymaps/333fred/keymap.c b/keyboards/handwired/dactyl_manuform/5x6_5/keymaps/333fred/keymap.c index f9b5ca6df..fd8c16420 100644 --- a/keyboards/handwired/dactyl_manuform/5x6_5/keymaps/333fred/keymap.c +++ b/keyboards/handwired/dactyl_manuform/5x6_5/keymaps/333fred/keymap.c | |||
| @@ -561,7 +561,7 @@ void oled_task_user(void) { | |||
| 561 | } | 561 | } |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | void encoder_update_user(uint8_t index, bool clockwise) { | 564 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 565 | // On the left, control the volume. On the right, scroll the page | 565 | // On the left, control the volume. On the right, scroll the page |
| 566 | if (index == 0) { | 566 | if (index == 0) { |
| 567 | if (clockwise) { | 567 | if (clockwise) { |
| @@ -576,4 +576,5 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 576 | tap_code(KC_VOLD); | 576 | tap_code(KC_VOLD); |
| 577 | } | 577 | } |
| 578 | } | 578 | } |
| 579 | return true; | ||
| 579 | } | 580 | } |
diff --git a/keyboards/handwired/daishi/keymaps/default/keymap.c b/keyboards/handwired/daishi/keymaps/default/keymap.c index eef82dd9b..5214e8b6f 100644 --- a/keyboards/handwired/daishi/keymaps/default/keymap.c +++ b/keyboards/handwired/daishi/keymaps/default/keymap.c | |||
| @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 36 | KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_P7 , KC_P8 , KC_P9 , KC_PPLS, | 36 | KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_P7 , KC_P8 , KC_P9 , KC_PPLS, |
| 37 | KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_P4 , KC_P5 , KC_P6 , KC_EQL , | 37 | KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_P4 , KC_P5 , KC_P6 , KC_EQL , |
| 38 | KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_P1 , KC_P2 , KC_P3 , KC_PENT, | 38 | KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_P1 , KC_P2 , KC_P3 , KC_PENT, |
| 39 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0 , KC_PDOT | 39 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0 , KC_PDOT |
| 40 | ), | 40 | ), |
| 41 | 41 | ||
| 42 | /* FN | 42 | /* FN |
| @@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 56 | * | | | | | | | | | | | | | | | | | | | | 56 | * | | | | | | | | | | | | | | | | | | | |
| 57 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------' | 57 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------------------------' |
| 58 | */ | 58 | */ |
| 59 | 59 | ||
| 60 | [_FN] = LAYOUT( /* Function */ | 60 | [_FN] = LAYOUT( /* Function */ |
| 61 | RESET , KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_F17 , KC_F18 , KC_F19 , KC_F20 , KC_F21 , DM_REC1, DM_REC2, DM_RSTP, _______, _______, _______, MO(_FN), DEBUG, | 61 | RESET , KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_F17 , KC_F18 , KC_F19 , KC_F20 , KC_F21 , DM_REC1, DM_REC2, DM_RSTP, _______, _______, _______, MO(_FN), DEBUG, |
| 62 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 62 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 64 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 64 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 65 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 65 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 66 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 66 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 67 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | 67 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ |
| 68 | ) | 68 | ) |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| @@ -73,23 +73,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 73 | switch(keycode) { | 73 | switch(keycode) { |
| 74 | case M_EXAMPLE1: | 74 | case M_EXAMPLE1: |
| 75 | SEND_STRING("This is an example macro!"SS_TAP(X_ENTER)); //prints "This is an example macro!" and hits Enter | 75 | SEND_STRING("This is an example macro!"SS_TAP(X_ENTER)); //prints "This is an example macro!" and hits Enter |
| 76 | return false; | 76 | return false; |
| 77 | case M_EXAMPLE2: | 77 | case M_EXAMPLE2: |
| 78 | SEND_STRING("This is a another example!"SS_TAP(X_ENTER)); //prints "This is a another example!" and hits Enter | 78 | SEND_STRING("This is a another example!"SS_TAP(X_ENTER)); //prints "This is a another example!" and hits Enter |
| 79 | return false; | 79 | return false; |
| 80 | } | 80 | } |
| 81 | } | 81 | } |
| 82 | return true; | 82 | return true; |
| 83 | }; | 83 | }; |
| 84 | 84 | ||
| 85 | void encoder_update(bool clockwise) { | 85 | bool encoder_update(bool clockwise) { |
| 86 | if (clockwise) { | 86 | if (clockwise) { |
| 87 | tap_code(KC_VOLU); | 87 | tap_code(KC_VOLU); |
| 88 | } else { | 88 | } else { |
| 89 | tap_code(KC_VOLD); | 89 | tap_code(KC_VOLD); |
| 90 | } | 90 | } |
| 91 | return true; | ||
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | void matrix_init_user(void) { | 94 | void matrix_init_user(void) { |
| 94 | // Call the keymap level matrix init. | 95 | // Call the keymap level matrix init. |
| 95 | 96 | ||
| @@ -115,4 +116,4 @@ void led_set_kb(uint8_t usb_led) { | |||
| 115 | } else { | 116 | } else { |
| 116 | writePinHigh(C6); | 117 | writePinHigh(C6); |
| 117 | } | 118 | } |
| 118 | } \ No newline at end of file | 119 | } |
diff --git a/keyboards/handwired/frankie_macropad/keymaps/default/keymap.c b/keyboards/handwired/frankie_macropad/keymaps/default/keymap.c index 02c1002af..b85d66c4c 100644 --- a/keyboards/handwired/frankie_macropad/keymaps/default/keymap.c +++ b/keyboards/handwired/frankie_macropad/keymaps/default/keymap.c | |||
| @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 23 | ), | 23 | ), |
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | void encoder_update_user(uint8_t index, bool clockwise) { | 26 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 27 | if (index == 0) { /* First encoder */ | 27 | if (index == 0) { /* First encoder */ |
| 28 | if (clockwise) { | 28 | if (clockwise) { |
| 29 | tap_code(KC_PGUP); | 29 | tap_code(KC_PGUP); |
| @@ -37,4 +37,5 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 37 | tap_code(KC_VOLD); | 37 | tap_code(KC_VOLD); |
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | return true; | ||
| 40 | } | 41 | } |
diff --git a/keyboards/handwired/hnah108/keymaps/default/keymap.c b/keyboards/handwired/hnah108/keymaps/default/keymap.c index 682ca0812..d4d4cde4b 100644 --- a/keyboards/handwired/hnah108/keymaps/default/keymap.c +++ b/keyboards/handwired/hnah108/keymaps/default/keymap.c | |||
| @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 46 | ) | 46 | ) |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | void encoder_update_user(uint8_t index, bool clockwise) { | 49 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 50 | if (index == 0) { | 50 | if (index == 0) { |
| 51 | if (IS_LAYER_ON(_FN)) { | 51 | if (IS_LAYER_ON(_FN)) { |
| 52 | if (clockwise) { | 52 | if (clockwise) { |
| @@ -62,6 +62,7 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 62 | } | 62 | } |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | return true; | ||
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | void rgb_matrix_indicators_user(void) { | 68 | void rgb_matrix_indicators_user(void) { |
diff --git a/keyboards/handwired/obuwunkunubi/spaget/keymaps/default/keymap.c b/keyboards/handwired/obuwunkunubi/spaget/keymaps/default/keymap.c index 1854894e5..5a30f5c57 100644 --- a/keyboards/handwired/obuwunkunubi/spaget/keymaps/default/keymap.c +++ b/keyboards/handwired/obuwunkunubi/spaget/keymaps/default/keymap.c | |||
| @@ -77,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 77 | KC_P1, KC_P2, KC_P3, \ | 77 | KC_P1, KC_P2, KC_P3, \ |
| 78 | KC_P0, KC_PDOT, KC_PENT \ | 78 | KC_P0, KC_PDOT, KC_PENT \ |
| 79 | ), | 79 | ), |
| 80 | 80 | ||
| 81 | /* Keymap ONE: Util Layer | 81 | /* Keymap ONE: Util Layer |
| 82 | * | 82 | * |
| 83 | * ,---. ,---. | 83 | * ,---. ,---. |
| @@ -371,7 +371,7 @@ void oled_task_user(void) { | |||
| 371 | } | 371 | } |
| 372 | #endif | 372 | #endif |
| 373 | 373 | ||
| 374 | void encoder_update_user(uint8_t index, bool clockwise) { | 374 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 375 | if(IS_LAYER_ON(BASE)) { | 375 | if(IS_LAYER_ON(BASE)) { |
| 376 | if (index == 0) { /* First encoder */ | 376 | if (index == 0) { /* First encoder */ |
| 377 | if (clockwise) { | 377 | if (clockwise) { |
| @@ -432,4 +432,5 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 432 | } | 432 | } |
| 433 | } | 433 | } |
| 434 | } | 434 | } |
| 435 | return true; | ||
| 435 | } | 436 | } |
diff --git a/keyboards/handwired/pill60/keymaps/default/keymap.c b/keyboards/handwired/pill60/keymaps/default/keymap.c index d9f0fa727..55996c018 100644 --- a/keyboards/handwired/pill60/keymaps/default/keymap.c +++ b/keyboards/handwired/pill60/keymaps/default/keymap.c | |||
| @@ -1,18 +1,18 @@ | |||
| 1 | /* Copyright 2020 Imam Rafii | 1 | /* Copyright 2020 Imam Rafii |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation, either version 2 of the License, or | 5 | * the Free Software Foundation, either version 2 of the License, or |
| 6 | * (at your option) any later version. | 6 | * (at your option) any later version. |
| 7 | * | 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
| 12 | * | 12 | * |
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include QMK_KEYBOARD_H | 16 | #include QMK_KEYBOARD_H |
| 17 | 17 | ||
| 18 | enum layers { | 18 | enum layers { |
| @@ -74,7 +74,7 @@ void oled_task_user(void) { | |||
| 74 | 74 | ||
| 75 | #ifdef ENCODER_ENABLE | 75 | #ifdef ENCODER_ENABLE |
| 76 | 76 | ||
| 77 | void encoder_update_user(uint8_t index, bool clockwise) { | 77 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 78 | if (index == 0) { /* First encoder */ | 78 | if (index == 0) { /* First encoder */ |
| 79 | if (clockwise) { | 79 | if (clockwise) { |
| 80 | tap_code(KC_A); | 80 | tap_code(KC_A); |
| @@ -82,6 +82,7 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 82 | tap_code(KC_B); | 82 | tap_code(KC_B); |
| 83 | } | 83 | } |
| 84 | } | 84 | } |
| 85 | return true; | ||
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | #endif | 88 | #endif |
diff --git a/keyboards/handwired/prkl30/keymaps/default/keymap.c b/keyboards/handwired/prkl30/keymaps/default/keymap.c index ce60a4193..be032739f 100644 --- a/keyboards/handwired/prkl30/keymaps/default/keymap.c +++ b/keyboards/handwired/prkl30/keymaps/default/keymap.c | |||
| @@ -81,12 +81,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 81 | 81 | ||
| 82 | }; | 82 | }; |
| 83 | 83 | ||
| 84 | void encoder_update_user(uint8_t index, bool clockwise) { | 84 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 85 | if (clockwise) { | 85 | if (clockwise) { |
| 86 | tap_code(KC_TAB); | 86 | tap_code(KC_TAB); |
| 87 | } else { | 87 | } else { |
| 88 | tap_code(KC_PGUP); | 88 | tap_code(KC_PGUP); |
| 89 | } | 89 | } |
| 90 | return true; | ||
| 90 | } | 91 | } |
| 91 | 92 | ||
| 92 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 93 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
diff --git a/keyboards/handwired/prkl30/keymaps/erkhal/keymap.c b/keyboards/handwired/prkl30/keymaps/erkhal/keymap.c index 4b01c9e09..71e5ed529 100644 --- a/keyboards/handwired/prkl30/keymaps/erkhal/keymap.c +++ b/keyboards/handwired/prkl30/keymaps/erkhal/keymap.c | |||
| @@ -81,12 +81,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 81 | 81 | ||
| 82 | }; | 82 | }; |
| 83 | 83 | ||
| 84 | void encoder_update_user(uint8_t index, bool clockwise) { | 84 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 85 | if (clockwise) { | 85 | if (clockwise) { |
| 86 | tap_code16(LCTL(KC_RIGHT)); | 86 | tap_code16(LCTL(KC_RIGHT)); |
| 87 | } else { | 87 | } else { |
| 88 | tap_code16(LCTL(KC_LEFT)); | 88 | tap_code16(LCTL(KC_LEFT)); |
| 89 | } | 89 | } |
| 90 | return true; | ||
| 90 | } | 91 | } |
| 91 | 92 | ||
| 92 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 93 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
diff --git a/keyboards/handwired/pytest/has_template/keymaps/nocpp/keymap.c b/keyboards/handwired/pytest/has_template/keymaps/nocpp/keymap.c index 4e06bb11e..65cd4cebe 100644 --- a/keyboards/handwired/pytest/has_template/keymaps/nocpp/keymap.c +++ b/keyboards/handwired/pytest/has_template/keymaps/nocpp/keymap.c | |||
| @@ -11,7 +11,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 11 | [0] = LAYOUT(KC_ENTER) | 11 | [0] = LAYOUT(KC_ENTER) |
| 12 | }; | 12 | }; |
| 13 | 13 | ||
| 14 | void encoder_update_user(uint8_t index, bool clockwise) { | 14 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 15 | if (index == 0) { | 15 | if (index == 0) { |
| 16 | if (clockwise) { | 16 | if (clockwise) { |
| 17 | tap_code(KC_UP); | 17 | tap_code(KC_UP); |
| @@ -19,5 +19,5 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
| 19 | tap_code(KC_DOWN); | 19 | tap_code(KC_DOWN); |
| 20 | } | 20 | } |
| 21 | } | 21 | } |
| 22 | 22 | return true; | |
| 23 | }; | 23 | }; |
diff --git a/keyboards/handwired/swiftrax/joypad/keymaps/default/keymap.c b/keyboards/handwired/swiftrax/joypad/keymaps/default/keymap.c index c5fd1b7d4..9ba0b6109 100644 --- a/keyboards/handwired/swiftrax/joypad/keymaps/default/keymap.c +++ b/keyboards/handwired/swiftrax/joypad/keymaps/default/keymap.c | |||
| @@ -27,10 +27,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 27 | 27 | ||
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | void encoder_update_user(uint8_t index, bool clockwise) { | 30 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 31 | if (clockwise) { | 31 | if (clockwise) { |
| 32 | tap_code(KC_VOLU); | 32 | tap_code(KC_VOLU); |
| 33 | } else { | 33 | } else { |
| 34 | tap_code(KC_VOLD); | 34 | tap_code(KC_VOLD); |
| 35 | } | 35 | } |
| 36 | return true; | ||
| 36 | } | 37 | } |
diff --git a/keyboards/handwired/swiftrax/joypad/keymaps/via/keymap.c b/keyboards/handwired/swiftrax/joypad/keymaps/via/keymap.c index 11a2e0125..254da6ac8 100644 --- a/keyboards/handwired/swiftrax/joypad/keymaps/via/keymap.c +++ b/keyboards/handwired/swiftrax/joypad/keymaps/via/keymap.c | |||
| @@ -42,10 +42,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | void encoder_update_user(uint8_t index, bool clockwise) { | 45 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 46 | if (clockwise) { | 46 | if (clockwise) { |
| 47 | tap_code(KC_VOLU); | 47 | tap_code(KC_VOLU); |
| 48 | } else { | 48 | } else { |
| 49 | tap_code(KC_VOLD); | 49 | tap_code(KC_VOLD); |
| 50 | } | 50 | } |
| 51 | return true; | ||
| 51 | } | 52 | } |
diff --git a/keyboards/handwired/swiftrax/pandamic/keymaps/default/keymap.c b/keyboards/handwired/swiftrax/pandamic/keymaps/default/keymap.c index 11e770921..3dd899227 100644 --- a/keyboards/handwired/swiftrax/pandamic/keymaps/default/keymap.c +++ b/keyboards/handwired/swiftrax/pandamic/keymaps/default/keymap.c | |||
| @@ -37,13 +37,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 37 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, | 37 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, |
| 38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 38 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 39 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | void encoder_update_user(uint8_t index, bool clockwise) { | 43 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 44 | if (clockwise) { | 44 | if (clockwise) { |
| 45 | tap_code(KC_VOLU); | 45 | tap_code(KC_VOLU); |
| 46 | } else { | 46 | } else { |
| 47 | tap_code(KC_VOLD); | 47 | tap_code(KC_VOLD); |
| 48 | } | 48 | } |
| 49 | } \ No newline at end of file | 49 | return true; |
| 50 | } | ||
diff --git a/keyboards/handwired/swiftrax/pandamic/keymaps/via/keymap.c b/keyboards/handwired/swiftrax/pandamic/keymaps/via/keymap.c index 38e455bec..877411206 100644 --- a/keyboards/handwired/swiftrax/pandamic/keymaps/via/keymap.c +++ b/keyboards/handwired/swiftrax/pandamic/keymaps/via/keymap.c | |||
| @@ -22,25 +22,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 22 | KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, | 22 | KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, |
| 23 | KC_P4, KC_P5, KC_P6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_END, | 23 | KC_P4, KC_P5, KC_P6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_END, |
| 24 | KC_P1, KC_P2, KC_P3, KC_PENT, KC_LSFT, MO(1), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_HOME, | 24 | KC_P1, KC_P2, KC_P3, KC_PENT, KC_LSFT, MO(1), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_HOME, |
| 25 | KC_P0, KC_PDOT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), | 25 | KC_P0, KC_PDOT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), |
| 26 | [1] = LAYOUT( | 26 | [1] = LAYOUT( |
| 27 | _______, _______, _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, | 27 | _______, _______, _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, |
| 28 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, | 28 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, |
| 29 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 29 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 30 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 30 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), |
| 32 | [2] = LAYOUT( | 32 | [2] = LAYOUT( |
| 33 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 33 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 34 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 34 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 35 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 35 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 36 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 36 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 37 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), | 37 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | void encoder_update_user(uint8_t index, bool clockwise) { | 40 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 41 | if (clockwise) { | 41 | if (clockwise) { |
| 42 | tap_code(KC_VOLU); | 42 | tap_code(KC_VOLU); |
| 43 | } else { | 43 | } else { |
| 44 | tap_code(KC_VOLD); | 44 | tap_code(KC_VOLD); |
| 45 | } | 45 | } |
| 46 | } \ No newline at end of file | 46 | return true; |
| 47 | } | ||
diff --git a/keyboards/handwired/swiftrax/walter/keymaps/via/keymap.c b/keyboards/handwired/swiftrax/walter/keymaps/via/keymap.c index cfa69d0c8..74d650bf5 100644 --- a/keyboards/handwired/swiftrax/walter/keymaps/via/keymap.c +++ b/keyboards/handwired/swiftrax/walter/keymaps/via/keymap.c | |||
| @@ -48,10 +48,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 48 | ), | 48 | ), |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | void encoder_update_user(uint8_t index, bool clockwise) { | 51 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 52 | if (clockwise) | 52 | if (clockwise) |
| 53 | tap_code16(KC_VOLU); | 53 | tap_code16(KC_VOLU); |
| 54 | else | 54 | else |
| 55 | tap_code16(KC_VOLD); | 55 | tap_code16(KC_VOLD); |
| 56 | 56 | return true; | |
| 57 | } \ No newline at end of file | 57 | } |
