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/np12 | |
| 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/np12')
| -rw-r--r-- | keyboards/np12/keymaps/default/keymap.c | 55 | ||||
| -rw-r--r-- | keyboards/np12/keymaps/via/keymap.c | 55 |
2 files changed, 54 insertions, 56 deletions
diff --git a/keyboards/np12/keymaps/default/keymap.c b/keyboards/np12/keymaps/default/keymap.c index 4a02b1d3a..f96057309 100644 --- a/keyboards/np12/keymaps/default/keymap.c +++ b/keyboards/np12/keymaps/default/keymap.c | |||
| @@ -1,18 +1,18 @@ | |||
| 1 | /* Copyright 2021 nut1414 | 1 | /* Copyright 2021 nut1414 |
| 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 | 16 | ||
| 17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
| 18 | 18 | ||
| @@ -22,39 +22,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 22 | [0] = LAYOUT( | 22 | [0] = LAYOUT( |
| 23 | KC_MPLY, | 23 | KC_MPLY, |
| 24 | KC_9, KC_6, KC_3, KC_PENT, | 24 | KC_9, KC_6, KC_3, KC_PENT, |
| 25 | KC_8, KC_5, KC_2, KC_BSPC, | 25 | KC_8, KC_5, KC_2, KC_BSPC, |
| 26 | KC_7, KC_4, KC_1, KC_0), | 26 | KC_7, KC_4, KC_1, KC_0), |
| 27 | 27 | ||
| 28 | [1] = LAYOUT( | 28 | [1] = LAYOUT( |
| 29 | KC_TRNS, | 29 | KC_TRNS, |
| 30 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 30 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 31 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 31 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 32 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 32 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 33 | 33 | ||
| 34 | [2] = LAYOUT( | 34 | [2] = LAYOUT( |
| 35 | KC_TRNS, | 35 | KC_TRNS, |
| 36 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 36 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 37 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 37 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 39 | 39 | ||
| 40 | [3] = LAYOUT( | 40 | [3] = LAYOUT( |
| 41 | KC_TRNS, | 41 | KC_TRNS, |
| 42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 43 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 43 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 44 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 44 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 45 | |||
| 46 | 45 | ||
| 47 | 46 | ||
| 47 | |||
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | void encoder_update_user(uint8_t index, bool clockwise) { | 50 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 51 | if (index == 0) { | 51 | if (index == 0) { |
| 52 | if (clockwise) { | 52 | if (clockwise) { |
| 53 | tap_code(KC_AUDIO_VOL_UP); | 53 | tap_code(KC_AUDIO_VOL_UP); |
| 54 | } else { | 54 | } else { |
| 55 | tap_code(KC_AUDIO_VOL_DOWN); | 55 | tap_code(KC_AUDIO_VOL_DOWN); |
| 56 | } | 56 | } |
| 57 | } | 57 | } |
| 58 | return true; | ||
| 58 | } | 59 | } |
| 59 | |||
| 60 | |||
diff --git a/keyboards/np12/keymaps/via/keymap.c b/keyboards/np12/keymaps/via/keymap.c index 4a02b1d3a..f96057309 100644 --- a/keyboards/np12/keymaps/via/keymap.c +++ b/keyboards/np12/keymaps/via/keymap.c | |||
| @@ -1,18 +1,18 @@ | |||
| 1 | /* Copyright 2021 nut1414 | 1 | /* Copyright 2021 nut1414 |
| 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 | 16 | ||
| 17 | #include QMK_KEYBOARD_H | 17 | #include QMK_KEYBOARD_H |
| 18 | 18 | ||
| @@ -22,39 +22,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 22 | [0] = LAYOUT( | 22 | [0] = LAYOUT( |
| 23 | KC_MPLY, | 23 | KC_MPLY, |
| 24 | KC_9, KC_6, KC_3, KC_PENT, | 24 | KC_9, KC_6, KC_3, KC_PENT, |
| 25 | KC_8, KC_5, KC_2, KC_BSPC, | 25 | KC_8, KC_5, KC_2, KC_BSPC, |
| 26 | KC_7, KC_4, KC_1, KC_0), | 26 | KC_7, KC_4, KC_1, KC_0), |
| 27 | 27 | ||
| 28 | [1] = LAYOUT( | 28 | [1] = LAYOUT( |
| 29 | KC_TRNS, | 29 | KC_TRNS, |
| 30 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 30 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 31 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 31 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 32 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 32 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 33 | 33 | ||
| 34 | [2] = LAYOUT( | 34 | [2] = LAYOUT( |
| 35 | KC_TRNS, | 35 | KC_TRNS, |
| 36 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 36 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 37 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 37 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 39 | 39 | ||
| 40 | [3] = LAYOUT( | 40 | [3] = LAYOUT( |
| 41 | KC_TRNS, | 41 | KC_TRNS, |
| 42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 43 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 43 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 44 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 44 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 45 | |||
| 46 | 45 | ||
| 47 | 46 | ||
| 47 | |||
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | void encoder_update_user(uint8_t index, bool clockwise) { | 50 | bool encoder_update_user(uint8_t index, bool clockwise) { |
| 51 | if (index == 0) { | 51 | if (index == 0) { |
| 52 | if (clockwise) { | 52 | if (clockwise) { |
| 53 | tap_code(KC_AUDIO_VOL_UP); | 53 | tap_code(KC_AUDIO_VOL_UP); |
| 54 | } else { | 54 | } else { |
| 55 | tap_code(KC_AUDIO_VOL_DOWN); | 55 | tap_code(KC_AUDIO_VOL_DOWN); |
| 56 | } | 56 | } |
| 57 | } | 57 | } |
| 58 | return true; | ||
| 58 | } | 59 | } |
| 59 | |||
| 60 | |||
