From 36ab0c0aaa613fe0946e10133315b071c0d87012 Mon Sep 17 00:00:00 2001 From: jack <0x6A73@pm.me> Date: Mon, 3 Apr 2023 10:18:17 -0600 Subject: [PATCH] Add core/fallback encoder behaviour (#20320) --- docs/feature_encoders.md | 14 +++---- keyboards/acheron/shark/beta/beta.c | 11 ------ keyboards/adafruit/macropad/macropad.c | 14 ------- keyboards/aidansmithdotdev/fine40/fine40.c | 15 ------- keyboards/anavi/knob1/knob1.c | 12 ------ keyboards/anavi/macropad10/macropad10.c | 16 -------- keyboards/ano/ano.c | 24 ------------ keyboards/atlantis/ps17/ps17.c | 17 -------- keyboards/bolsa/damapad/damapad.c | 14 ------- keyboards/cannonkeys/balance/balance.c | 10 ----- keyboards/cannonkeys/ortho60v2/ortho60v2.c | 14 ------- .../phoenix45_ortho/phoenix45_ortho.c | 29 -------------- keyboards/checkerboards/quark/quark.c | 29 -------------- .../quark_squared/quark_squared.c | 12 ------ keyboards/chocofly/chocofly.c | 16 -------- keyboards/ck60i/ck60i.c | 12 ------ keyboards/coban/pad3a/pad3a.c | 29 -------------- keyboards/crbn/crbn.c | 27 ------------- keyboards/custommk/genesis/rev1/rev1.c | 38 ------------------ keyboards/custommk/genesis/rev2/rev2.c | 39 ------------------- keyboards/drhigsby/packrat/packrat.c | 12 ------ keyboards/drop/sense75/sense75.c | 13 ------- keyboards/dumbpad/v3x/v3x.c | 19 --------- keyboards/evolv/evolv.c | 10 ----- keyboards/eyeohdesigns/sprh/sprh.c | 14 ------- .../eyeohdesigns/theboulevard/theboulevard.c | 14 ------- keyboards/ffkeebs/puca/puca.c | 11 ------ keyboards/geistmaschine/geist/geist.c | 21 ---------- keyboards/geistmaschine/macropod/macropod.c | 21 ---------- keyboards/gmmk/numpad/numpad.c | 14 ------- keyboards/gmmk/pro/pro.c | 30 -------------- keyboards/gorthage_truck/gorthage_truck.c | 12 ------ .../daskeyboard/daskeyboard4/daskeyboard4.c | 19 --------- .../maverick0197/keydeck8/keydeck8.c | 33 ---------------- .../handwired/swiftrax/bumblebee/bumblebee.c | 11 ------ .../swiftrax/digicarp65/digicarp65.c | 14 ------- keyboards/handwired/tsubasa/tsubasa.c | 14 ------- keyboards/io_mini1800/io_mini1800.c | 14 ------- keyboards/jagdpietr/drakon/drakon.c | 10 ----- .../jkeys_design/gentleman65/gentleman65.c | 12 ------ .../gentleman65_se_s/gentleman65_se_s.c | 14 ------- keyboards/kapcave/arya/arya.c | 10 ----- keyboards/keebio/dsp40/rev1/rev1.c | 12 ------ keyboards/keebsforall/coarse60/coarse60.c | 12 ------ keyboards/keebsforall/freebirdnp/pro/pro.c | 28 ------------- keyboards/keychron/v10/v10.c | 14 ------- keyboards/keychron/v6/v6.c | 14 ------- keyboards/keyprez/rhino/rhino.c | 6 --- keyboards/keyprez/unicorn/unicorn.c | 14 ------- .../gameroyadvance/gameroyadvance.c | 28 ------------- keyboards/kiwikeebs/macro/macro.c | 12 ------ keyboards/kiwikeebs/macro_v2/macro_v2.c | 12 ------ keyboards/kiwikey/borderland/borderland.c | 14 ------- keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c | 14 ------- keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c | 14 ------- .../latincompass/latinpadble/latinpadble.c | 10 ----- keyboards/ll3macorn/bongopad/bongopad.c | 16 -------- keyboards/lpad/lpad.c | 18 --------- keyboards/lw67/lw67.c | 13 ------- keyboards/lw75/lw75.c | 15 ------- keyboards/lyso1/lck75/lck75.c | 12 ------ keyboards/macro1/macro1.c | 15 ------- keyboards/mechwild/bde/rev2/rev2.c | 16 -------- keyboards/mechwild/mercutio/mercutio.c | 19 --------- keyboards/mechwild/obe/obe.c | 16 -------- keyboards/mechwild/waka60/waka60.c | 16 -------- keyboards/meletrix/zoom65/zoom65.c | 6 --- keyboards/meletrix/zoom65_lite/zoom65_lite.c | 8 ---- keyboards/metamechs/timberwolf/timberwolf.c | 10 ----- keyboards/mini_elixivy/mini_elixivy.c | 11 ------ keyboards/mk65/mk65.c | 31 --------------- keyboards/mwstudio/alicekk/alicekk.c | 14 ------- keyboards/mwstudio/mw80/mw80.c | 31 --------------- keyboards/nullbitsco/snap/snap.c | 14 ------- keyboards/onekeyco/dango40/dango40.c | 10 ----- keyboards/orthocode/orthocode.c | 13 ------- keyboards/pauperboards/brick/brick.c | 31 --------------- keyboards/pearlboards/atlas/atlas.c | 14 ------- keyboards/pearlboards/pandora/pandora.c | 18 --------- keyboards/pearlboards/zeus/zeus.c | 17 -------- keyboards/pearlboards/zeuspad/zeuspad.c | 18 --------- keyboards/pica40/rev1/rev1.c | 12 ------ keyboards/program_yoink/program_yoink.c | 29 -------------- keyboards/rart/rart75hs/rart75hs.c | 16 -------- keyboards/rart/rart75m/rart75m.c | 16 -------- keyboards/rart/rartland/rartland.c | 16 -------- keyboards/reedskeebs/alish40/alish40.c | 22 ----------- keyboards/ristretto/ristretto.c | 12 ------ keyboards/rmkeebs/rm_numpad/rm_numpad.c | 31 --------------- keyboards/rotr/rotr.c | 10 ----- keyboards/rubi/rubi.c | 5 --- .../krush/krush65/hotswap/hotswap.c | 14 ------- .../sneakbox/aliceclonergb/aliceclonergb.c | 14 ------- keyboards/spacey/spacey.c | 12 ------ keyboards/sthlmkb/litl/litl.c | 14 ------- keyboards/taleguers/taleguers75/taleguers75.c | 11 ------ keyboards/tau4/tau4.c | 14 ------- keyboards/thepanduuh/degenpad/degenpad.c | 31 --------------- keyboards/tkc/portico75/portico75.c | 16 -------- keyboards/tominabox1/bigboy/bigboy.c | 31 --------------- keyboards/ungodly/nines/nines.c | 34 ---------------- keyboards/viendi8l/viendi8l.c | 11 ------ keyboards/work_louder/work_board/work_board.c | 14 ------- keyboards/wuque/mammoth75x/mammoth75x.c | 6 --- keyboards/wuque/serneity65/serneity65.c | 11 ------ keyboards/z12/z12.c | 23 ----------- quantum/encoder.c | 24 +++++++++++- 107 files changed, 30 insertions(+), 1759 deletions(-) delete mode 100644 keyboards/anavi/macropad10/macropad10.c delete mode 100644 keyboards/checkerboards/phoenix45_ortho/phoenix45_ortho.c delete mode 100644 keyboards/checkerboards/quark/quark.c delete mode 100644 keyboards/chocofly/chocofly.c delete mode 100644 keyboards/coban/pad3a/pad3a.c delete mode 100644 keyboards/crbn/crbn.c delete mode 100644 keyboards/custommk/genesis/rev1/rev1.c delete mode 100644 keyboards/custommk/genesis/rev2/rev2.c delete mode 100644 keyboards/geistmaschine/geist/geist.c delete mode 100644 keyboards/geistmaschine/macropod/macropod.c delete mode 100644 keyboards/gmmk/pro/pro.c delete mode 100644 keyboards/handwired/daskeyboard/daskeyboard4/daskeyboard4.c delete mode 100644 keyboards/handwired/maverick0197/keydeck8/keydeck8.c delete mode 100644 keyboards/keebsforall/freebirdnp/pro/pro.c delete mode 100644 keyboards/lpad/lpad.c delete mode 100644 keyboards/mk65/mk65.c delete mode 100644 keyboards/mwstudio/mw80/mw80.c delete mode 100644 keyboards/pauperboards/brick/brick.c delete mode 100644 keyboards/program_yoink/program_yoink.c delete mode 100644 keyboards/reedskeebs/alish40/alish40.c delete mode 100644 keyboards/rmkeebs/rm_numpad/rm_numpad.c delete mode 100644 keyboards/thepanduuh/degenpad/degenpad.c delete mode 100755 keyboards/tominabox1/bigboy/bigboy.c delete mode 100644 keyboards/ungodly/nines/nines.c delete mode 100644 keyboards/z12/z12.c diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index 1c521a4eff7c..74857c265dd6 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -102,9 +102,9 @@ Using encoder mapping pumps events through the normal QMK keycode processing pip ## Callbacks -When not using `ENCODER_MAP_ENABLE = yes`, the callback functions can be inserted into your `.c`: +?> [**Default Behaviour**](https://github.com/qmk/qmk_firmware/blob/master/quantum/encoder.c#L79-#L98): all encoders installed will function as volume up (`KC_VOLU`) on clockwise rotation and volume down (`KC_VOLD`) on counter-clockwise rotation. If you do not wish to override this, no further configuration is necessary. -?> Those who are adding new keyboard support where encoders are enabled at the keyboard level should include basic encoder functionality at the keyboard level (`.c`) using the `encoder_update_kb()` function, that way it works for QMK Configuator users and exists in general. +If you would like the alter the default behaviour, and are not using `ENCODER_MAP_ENABLE = yes`, the callback functions can be inserted into your `.c`: ```c bool encoder_update_kb(uint8_t index, bool clockwise) { @@ -113,9 +113,9 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { } if (index == 0) { /* First encoder */ if (clockwise) { - tap_code_delay(KC_VOLU, 10); + tap_code(KC_PGDN); } else { - tap_code_delay(KC_VOLD, 10); + tap_code(KC_PGUP); } } else if (index == 1) { /* Second encoder */ if (clockwise) { @@ -134,9 +134,9 @@ or `keymap.c`: bool encoder_update_user(uint8_t index, bool clockwise) { if (index == 0) { /* First encoder */ if (clockwise) { - tap_code_delay(KC_VOLU, 10); + tap_code(KC_PGDN); } else { - tap_code_delay(KC_VOLD, 10); + tap_code(KC_PGUP); } } else if (index == 1) { /* Second encoder */ if (clockwise) { @@ -149,7 +149,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } ``` -!> If you return `true` in the keymap level `_user` function, it will allow the keyboard level encoder code to run on top of your own. Returning `false` will override the keyboard level function, if setup correctly. This is generally the safest option to avoid confusion. +!> If you return `true` in the keymap level `_user` function, it will allow the keyboard/core level encoder code to run on top of your own. Returning `false` will override the keyboard level function, if setup correctly. This is generally the safest option to avoid confusion. ## Hardware diff --git a/keyboards/acheron/shark/beta/beta.c b/keyboards/acheron/shark/beta/beta.c index 06fd36f7972e..5592353ad766 100644 --- a/keyboards/acheron/shark/beta/beta.c +++ b/keyboards/acheron/shark/beta/beta.c @@ -20,14 +20,3 @@ void board_init(void) { setPinInput(B6); setPinInput(B7); } - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if(!encoder_update_user(index, clockwise)) return false; - if (index == 0) { - if (clockwise) tap_code_delay(KC_VOLU, 10); - else tap_code_delay(KC_VOLD, 10); - } - return true; -} -#endif diff --git a/keyboards/adafruit/macropad/macropad.c b/keyboards/adafruit/macropad/macropad.c index 5cffdc6c97de..819b5067d8a5 100644 --- a/keyboards/adafruit/macropad/macropad.c +++ b/keyboards/adafruit/macropad/macropad.c @@ -40,17 +40,3 @@ led_config_t g_led_config = { { } }; #endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/aidansmithdotdev/fine40/fine40.c b/keyboards/aidansmithdotdev/fine40/fine40.c index 0bd190321a2e..2e60e7c9219e 100644 --- a/keyboards/aidansmithdotdev/fine40/fine40.c +++ b/keyboards/aidansmithdotdev/fine40/fine40.c @@ -68,18 +68,3 @@ bool oled_task_kb(void) { return(true); } #endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - // Volume control - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/anavi/knob1/knob1.c b/keyboards/anavi/knob1/knob1.c index c1ed7b7726ca..bb6f1e38bfd0 100644 --- a/keyboards/anavi/knob1/knob1.c +++ b/keyboards/anavi/knob1/knob1.c @@ -14,18 +14,6 @@ void keyboard_post_init_kb(void) { keyboard_post_init_user(); } -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} -#endif - #ifdef OLED_ENABLE bool oled_task_kb(void) { diff --git a/keyboards/anavi/macropad10/macropad10.c b/keyboards/anavi/macropad10/macropad10.c deleted file mode 100644 index bebefd0da9e7..000000000000 --- a/keyboards/anavi/macropad10/macropad10.c +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2022 Leon Anavi -// SPDX-License-Identifier: GPL-2.0-or-later -#include "encoder.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} -#endif - diff --git a/keyboards/ano/ano.c b/keyboards/ano/ano.c index 0b6926deafd3..925a24fbf689 100644 --- a/keyboards/ano/ano.c +++ b/keyboards/ano/ano.c @@ -15,27 +15,3 @@ */ #include "ano.h" - -/* The encoder_update_user is a function. - * It'll be called by QMK every time you turn the encoder. - * - * The index parameter tells you which encoder was turned. If you only have - * one encoder, the index will always be zero. - * - * The clockwise parameter tells you the direction of the encoder. It'll be - * true when you turned the encoder clockwise, and false otherwise. - */ - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_AUDIO_VOL_UP); - } else { - tap_code(KC_AUDIO_VOL_DOWN); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/atlantis/ps17/ps17.c b/keyboards/atlantis/ps17/ps17.c index ccac1ce9230d..d660bdee6a9b 100644 --- a/keyboards/atlantis/ps17/ps17.c +++ b/keyboards/atlantis/ps17/ps17.c @@ -19,23 +19,6 @@ void keyboard_pre_init_kb(void) { keyboard_pre_init_user(); } -#if defined(ENCODER_ENABLE) -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - /* Don't process further events if user function exists and returns false */ - return false; - } - - /* Ignore index - only one encoder on this board */ - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - return false; -} -#endif - #ifdef RGB_MATRIX_ENABLE void suspend_power_down_kb(void) { /* Disable indicator LEDs when going to sleep */ diff --git a/keyboards/bolsa/damapad/damapad.c b/keyboards/bolsa/damapad/damapad.c index d57a60c1669c..c2464d3f9562 100644 --- a/keyboards/bolsa/damapad/damapad.c +++ b/keyboards/bolsa/damapad/damapad.c @@ -65,17 +65,3 @@ oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_180; } #endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/cannonkeys/balance/balance.c b/keyboards/cannonkeys/balance/balance.c index 2bb4485521d8..b0de0a3ae331 100644 --- a/keyboards/cannonkeys/balance/balance.c +++ b/keyboards/cannonkeys/balance/balance.c @@ -15,13 +15,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "balance.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} diff --git a/keyboards/cannonkeys/ortho60v2/ortho60v2.c b/keyboards/cannonkeys/ortho60v2/ortho60v2.c index 0fc9239ee880..3e0248abda29 100644 --- a/keyboards/cannonkeys/ortho60v2/ortho60v2.c +++ b/keyboards/cannonkeys/ortho60v2/ortho60v2.c @@ -15,17 +15,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "ortho60v2.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - return true; -} -#endif diff --git a/keyboards/checkerboards/phoenix45_ortho/phoenix45_ortho.c b/keyboards/checkerboards/phoenix45_ortho/phoenix45_ortho.c deleted file mode 100644 index cb1615aef0d8..000000000000 --- a/keyboards/checkerboards/phoenix45_ortho/phoenix45_ortho.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2021 Nathan Spears - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLD, 10); - } else { - tap_code_delay(KC_VOLU, 10); - } - } - return true; -} diff --git a/keyboards/checkerboards/quark/quark.c b/keyboards/checkerboards/quark/quark.c deleted file mode 100644 index 22769b51c1e4..000000000000 --- a/keyboards/checkerboards/quark/quark.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2020 Nathan Spears - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLD, 10); - } else { - tap_code_delay(KC_VOLU, 10); - } - } - return true; -} diff --git a/keyboards/checkerboards/quark_squared/quark_squared.c b/keyboards/checkerboards/quark_squared/quark_squared.c index 1ead754eaf95..fbd7346cc0d5 100644 --- a/keyboards/checkerboards/quark_squared/quark_squared.c +++ b/keyboards/checkerboards/quark_squared/quark_squared.c @@ -15,15 +15,3 @@ */ #include "quark_squared.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLD, 10); - } else { - tap_code_delay(KC_VOLU, 10); - } - } - return true; -} diff --git a/keyboards/chocofly/chocofly.c b/keyboards/chocofly/chocofly.c deleted file mode 100644 index 0f00afe2f998..000000000000 --- a/keyboards/chocofly/chocofly.c +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2022 Vitaly Volkov (@vlkv) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return false; -} -#endif diff --git a/keyboards/ck60i/ck60i.c b/keyboards/ck60i/ck60i.c index 7e5cd3321864..b102aad40c62 100644 --- a/keyboards/ck60i/ck60i.c +++ b/keyboards/ck60i/ck60i.c @@ -16,15 +16,3 @@ along with this program. If not, see . */ #include "ck60i.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/coban/pad3a/pad3a.c b/keyboards/coban/pad3a/pad3a.c deleted file mode 100644 index bd07a83a8f23..000000000000 --- a/keyboards/coban/pad3a/pad3a.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2021 RyanDam (https://github.com/RyanDam) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#if defined(ENCODER_ENABLE) -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - return true; -} -#endif diff --git a/keyboards/crbn/crbn.c b/keyboards/crbn/crbn.c deleted file mode 100644 index 91787f9c1cec..000000000000 --- a/keyboards/crbn/crbn.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2020 Harry Herring - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -/* Encoder setting. only one encoder despite 4 possible spots */ -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} diff --git a/keyboards/custommk/genesis/rev1/rev1.c b/keyboards/custommk/genesis/rev1/rev1.c deleted file mode 100644 index f81c6943b3f3..000000000000 --- a/keyboards/custommk/genesis/rev1/rev1.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright 2020 customMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - /* top left encoder */ - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - /* top right encoder */ - else if (index == 1) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/custommk/genesis/rev2/rev2.c b/keyboards/custommk/genesis/rev2/rev2.c deleted file mode 100644 index 5993ebb8c6dd..000000000000 --- a/keyboards/custommk/genesis/rev2/rev2.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2020 customMK - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - /* top left encoder */ - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - /* top right encoder */ - else if (index == 1) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return false; -} - diff --git a/keyboards/drhigsby/packrat/packrat.c b/keyboards/drhigsby/packrat/packrat.c index 0f4a479956a0..dc8f3b41b421 100644 --- a/keyboards/drhigsby/packrat/packrat.c +++ b/keyboards/drhigsby/packrat/packrat.c @@ -14,15 +14,3 @@ * along with this program. If not, see . */ #include "packrat.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} diff --git a/keyboards/drop/sense75/sense75.c b/keyboards/drop/sense75/sense75.c index a8cb28b054c9..cbc194ee8fbc 100644 --- a/keyboards/drop/sense75/sense75.c +++ b/keyboards/drop/sense75/sense75.c @@ -133,16 +133,3 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { { 1, H_16, G_16, I_16 } }; #endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return false; -} -#endif diff --git a/keyboards/dumbpad/v3x/v3x.c b/keyboards/dumbpad/v3x/v3x.c index 7af3c4e838e9..9a4c8f444273 100644 --- a/keyboards/dumbpad/v3x/v3x.c +++ b/keyboards/dumbpad/v3x/v3x.c @@ -100,22 +100,3 @@ bool led_update_kb(led_t led_state) { writePin(LED_02, !led_state.num_lock); return true; } - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - switch (get_highest_layer(layer_state)) { - case 0: - // main layer, volume - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif diff --git a/keyboards/evolv/evolv.c b/keyboards/evolv/evolv.c index 3f2762894614..54f92c9dbc4d 100644 --- a/keyboards/evolv/evolv.c +++ b/keyboards/evolv/evolv.c @@ -16,13 +16,3 @@ along with this program. If not, see . */ #include "evolv.h" - -#ifndef MEDIA_KEY_DELAY -# define MEDIA_KEY_DELAY 100 -#endif - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - tap_code_delay(clockwise ? KC_VOLU : KC_VOLD, MEDIA_KEY_DELAY); - return true; -} diff --git a/keyboards/eyeohdesigns/sprh/sprh.c b/keyboards/eyeohdesigns/sprh/sprh.c index 903e0c68e2ed..f73b463d791e 100644 --- a/keyboards/eyeohdesigns/sprh/sprh.c +++ b/keyboards/eyeohdesigns/sprh/sprh.c @@ -14,17 +14,3 @@ * along with this program. If not, see . */ #include "sprh.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/eyeohdesigns/theboulevard/theboulevard.c b/keyboards/eyeohdesigns/theboulevard/theboulevard.c index a2b40cd9e9ba..5671425698ca 100644 --- a/keyboards/eyeohdesigns/theboulevard/theboulevard.c +++ b/keyboards/eyeohdesigns/theboulevard/theboulevard.c @@ -15,17 +15,3 @@ */ #include "theboulevard.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/ffkeebs/puca/puca.c b/keyboards/ffkeebs/puca/puca.c index 21944a9e5d50..9d9f739a6f4b 100644 --- a/keyboards/ffkeebs/puca/puca.c +++ b/keyboards/ffkeebs/puca/puca.c @@ -29,17 +29,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { return true; } -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code_delay(KC_VOLU, 10); // Right - } else { - tap_code_delay(KC_VOLD, 10); // Left - } - return false; -} - - // OLED #ifdef OLED_ENABLE __attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } diff --git a/keyboards/geistmaschine/geist/geist.c b/keyboards/geistmaschine/geist/geist.c deleted file mode 100644 index 2f6825e2ee13..000000000000 --- a/keyboards/geistmaschine/geist/geist.c +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 QMK -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "quantum.h" - -// This will be overridden by encoder map in all default keymaps, but serves as a catch-all for user keymaps that may omit the map. -#if defined (ENCODER_ENABLE) && !defined (ENCODER_MAP_ENABLE) -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; /* Don't process further events if user function exists and returns false */ - } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/geistmaschine/macropod/macropod.c b/keyboards/geistmaschine/macropod/macropod.c deleted file mode 100644 index 2f6825e2ee13..000000000000 --- a/keyboards/geistmaschine/macropod/macropod.c +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 QMK -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "quantum.h" - -// This will be overridden by encoder map in all default keymaps, but serves as a catch-all for user keymaps that may omit the map. -#if defined (ENCODER_ENABLE) && !defined (ENCODER_MAP_ENABLE) -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; /* Don't process further events if user function exists and returns false */ - } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/gmmk/numpad/numpad.c b/keyboards/gmmk/numpad/numpad.c index ed4fed266782..f1a46170fd76 100644 --- a/keyboards/gmmk/numpad/numpad.c +++ b/keyboards/gmmk/numpad/numpad.c @@ -120,17 +120,3 @@ void keyboard_pre_init_user(void) { # endif #endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - return true; -} -#endif diff --git a/keyboards/gmmk/pro/pro.c b/keyboards/gmmk/pro/pro.c deleted file mode 100644 index 3df15d71f2fb..000000000000 --- a/keyboards/gmmk/pro/pro.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright 2021 Glorious, LLC - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - return false; -} -#endif diff --git a/keyboards/gorthage_truck/gorthage_truck.c b/keyboards/gorthage_truck/gorthage_truck.c index 27456669168d..c6f75d72706c 100644 --- a/keyboards/gorthage_truck/gorthage_truck.c +++ b/keyboards/gorthage_truck/gorthage_truck.c @@ -15,15 +15,3 @@ */ #include "gorthage_truck.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/handwired/daskeyboard/daskeyboard4/daskeyboard4.c b/keyboards/handwired/daskeyboard/daskeyboard4/daskeyboard4.c deleted file mode 100644 index 37d67007df37..000000000000 --- a/keyboards/handwired/daskeyboard/daskeyboard4/daskeyboard4.c +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 Commander1024 (@Commander1024) -// SPDX-License-Identifier: GPL-2.0-or-later -#include "quantum.h" - -// rotary encoder -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - // Volume control - if (clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - return true; -}; -#endif diff --git a/keyboards/handwired/maverick0197/keydeck8/keydeck8.c b/keyboards/handwired/maverick0197/keydeck8/keydeck8.c deleted file mode 100644 index 663306a9bb2a..000000000000 --- a/keyboards/handwired/maverick0197/keydeck8/keydeck8.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2023 Maverick0197 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - //if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - //} - return false; -}; -#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/handwired/swiftrax/bumblebee/bumblebee.c b/keyboards/handwired/swiftrax/bumblebee/bumblebee.c index 1199b90b1f75..9c3444955c0d 100644 --- a/keyboards/handwired/swiftrax/bumblebee/bumblebee.c +++ b/keyboards/handwired/swiftrax/bumblebee/bumblebee.c @@ -16,17 +16,6 @@ along with this program. If not, see . */ #include "bumblebee.h" -// Encoder -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) - return false; - if (clockwise) - tap_code(KC_VOLU); - else - tap_code(KC_VOLD); - return true; -} - // Initialize all RGB indicators to 'off' void keyboard_post_init_kb(void) { rgblight_setrgb_at(0, 0, 0, 0); // [..., 0] = top LED diff --git a/keyboards/handwired/swiftrax/digicarp65/digicarp65.c b/keyboards/handwired/swiftrax/digicarp65/digicarp65.c index 99823a756c76..4e5413cc14ed 100644 --- a/keyboards/handwired/swiftrax/digicarp65/digicarp65.c +++ b/keyboards/handwired/swiftrax/digicarp65/digicarp65.c @@ -15,17 +15,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "digicarp65.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/handwired/tsubasa/tsubasa.c b/keyboards/handwired/tsubasa/tsubasa.c index 5ae19c185ada..78d27b57a8aa 100644 --- a/keyboards/handwired/tsubasa/tsubasa.c +++ b/keyboards/handwired/tsubasa/tsubasa.c @@ -16,20 +16,6 @@ #include "tsubasa.h" -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif - #ifdef OLED_ENABLE static void render_scrl(void) { static const char PROGMEM raw_scrl[] = { diff --git a/keyboards/io_mini1800/io_mini1800.c b/keyboards/io_mini1800/io_mini1800.c index aa500c469a08..7f148a392722 100644 --- a/keyboards/io_mini1800/io_mini1800.c +++ b/keyboards/io_mini1800/io_mini1800.c @@ -2,17 +2,3 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "io_mini1800.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/jagdpietr/drakon/drakon.c b/keyboards/jagdpietr/drakon/drakon.c index 65d950305526..59b7a4fba5a4 100644 --- a/keyboards/jagdpietr/drakon/drakon.c +++ b/keyboards/jagdpietr/drakon/drakon.c @@ -18,16 +18,6 @@ char wpm_str[10]; -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} - #ifdef OLED_ENABLE // Defines names for use in layer keycodes and the keymap diff --git a/keyboards/jkeys_design/gentleman65/gentleman65.c b/keyboards/jkeys_design/gentleman65/gentleman65.c index 9e9baa011e66..8d2af0e150b9 100644 --- a/keyboards/jkeys_design/gentleman65/gentleman65.c +++ b/keyboards/jkeys_design/gentleman65/gentleman65.c @@ -16,15 +16,3 @@ */ #include "gentleman65.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code_delay(KC_AUDIO_VOL_UP, 10); - } else { - tap_code_delay(KC_AUDIO_VOL_DOWN, 10); - } - } - return true; -} \ No newline at end of file diff --git a/keyboards/jkeys_design/gentleman65_se_s/gentleman65_se_s.c b/keyboards/jkeys_design/gentleman65_se_s/gentleman65_se_s.c index 1b6133cf2a73..26497072158f 100644 --- a/keyboards/jkeys_design/gentleman65_se_s/gentleman65_se_s.c +++ b/keyboards/jkeys_design/gentleman65_se_s/gentleman65_se_s.c @@ -16,17 +16,3 @@ */ #include "gentleman65_se_s.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code_delay(KC_AUDIO_VOL_UP, 10); - } else { - tap_code_delay(KC_AUDIO_VOL_DOWN, 10); - } - } - return true; -} -#endif diff --git a/keyboards/kapcave/arya/arya.c b/keyboards/kapcave/arya/arya.c index af5d19be4fff..13cae06189c3 100644 --- a/keyboards/kapcave/arya/arya.c +++ b/keyboards/kapcave/arya/arya.c @@ -15,13 +15,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "arya.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} diff --git a/keyboards/keebio/dsp40/rev1/rev1.c b/keyboards/keebio/dsp40/rev1/rev1.c index dbaea8d4cc7a..091cfc152383 100644 --- a/keyboards/keebio/dsp40/rev1/rev1.c +++ b/keyboards/keebio/dsp40/rev1/rev1.c @@ -24,15 +24,3 @@ void eeconfig_init_kb(void) { eeconfig_update_kb(0); eeconfig_init_user(); } - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return false; -} diff --git a/keyboards/keebsforall/coarse60/coarse60.c b/keyboards/keebsforall/coarse60/coarse60.c index 8287eec1a862..a609a09588a7 100644 --- a/keyboards/keebsforall/coarse60/coarse60.c +++ b/keyboards/keebsforall/coarse60/coarse60.c @@ -15,15 +15,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "coarse60.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/keebsforall/freebirdnp/pro/pro.c b/keyboards/keebsforall/freebirdnp/pro/pro.c deleted file mode 100644 index b98dfd6082df..000000000000 --- a/keyboards/keebsforall/freebirdnp/pro/pro.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright 2021 Elliot Powell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "quantum.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return false; -} diff --git a/keyboards/keychron/v10/v10.c b/keyboards/keychron/v10/v10.c index 091c2e9a4b22..2e1e3f090f03 100644 --- a/keyboards/keychron/v10/v10.c +++ b/keyboards/keychron/v10/v10.c @@ -84,17 +84,3 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { } #endif // CAPS_LOCK_LED_INDEX - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/keychron/v6/v6.c b/keyboards/keychron/v6/v6.c index 02708e7bc139..0f9305d2d05f 100644 --- a/keyboards/keychron/v6/v6.c +++ b/keyboards/keychron/v6/v6.c @@ -98,17 +98,3 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { } #endif // RGB_MATRIX_ENABLE... - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/keyprez/rhino/rhino.c b/keyboards/keyprez/rhino/rhino.c index fa0ae901c992..d2e1bf2e2343 100644 --- a/keyboards/keyprez/rhino/rhino.c +++ b/keyboards/keyprez/rhino/rhino.c @@ -17,12 +17,6 @@ #include "quantum.h" #include QMK_KEYBOARD_H -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - tap_code(clockwise ? KC_VOLU : KC_VOLD); - return true; -} - __attribute__ ((weak)) const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_2x2u( 0, diff --git a/keyboards/keyprez/unicorn/unicorn.c b/keyboards/keyprez/unicorn/unicorn.c index 0ddd49658b44..213ed629ac07 100644 --- a/keyboards/keyprez/unicorn/unicorn.c +++ b/keyboards/keyprez/unicorn/unicorn.c @@ -2,17 +2,3 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "unicorn.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/keystonecaps/gameroyadvance/gameroyadvance.c b/keyboards/keystonecaps/gameroyadvance/gameroyadvance.c index 797f4dba765f..70c49ce118f2 100644 --- a/keyboards/keystonecaps/gameroyadvance/gameroyadvance.c +++ b/keyboards/keystonecaps/gameroyadvance/gameroyadvance.c @@ -16,31 +16,3 @@ along with this program. If not, see . */ #include "gameroyadvance.h" - - - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index, clockwise)) { return false; } - - if (index == 0) { - - if (clockwise) { - - tap_code_delay(KC_VOLU, 10); - - } else { - - tap_code_delay(KC_VOLD, 10); - - } - - } - - return true; - -} - -#endif diff --git a/keyboards/kiwikeebs/macro/macro.c b/keyboards/kiwikeebs/macro/macro.c index 5eb03509e5b7..cc854cf139e3 100644 --- a/keyboards/kiwikeebs/macro/macro.c +++ b/keyboards/kiwikeebs/macro/macro.c @@ -15,15 +15,3 @@ */ #include "macro.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_AUDIO_VOL_UP); - } else { - tap_code(KC_AUDIO_VOL_DOWN); - } - } - return true; -} diff --git a/keyboards/kiwikeebs/macro_v2/macro_v2.c b/keyboards/kiwikeebs/macro_v2/macro_v2.c index 795da21cc981..dd921f290feb 100644 --- a/keyboards/kiwikeebs/macro_v2/macro_v2.c +++ b/keyboards/kiwikeebs/macro_v2/macro_v2.c @@ -15,15 +15,3 @@ */ #include "macro_v2.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_AUDIO_VOL_UP); - } else { - tap_code(KC_AUDIO_VOL_DOWN); - } - } - return true; -} diff --git a/keyboards/kiwikey/borderland/borderland.c b/keyboards/kiwikey/borderland/borderland.c index 660e8026fc7a..371dc73098ac 100644 --- a/keyboards/kiwikey/borderland/borderland.c +++ b/keyboards/kiwikey/borderland/borderland.c @@ -2,17 +2,3 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "borderland.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c b/keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c index 9f7333b7212e..499edf6e5ff7 100644 --- a/keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c +++ b/keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c @@ -57,17 +57,3 @@ bool rgb_matrix_indicators_kb(void) { } return true; } - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c b/keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c index 6cb40e062213..001debe1281b 100644 --- a/keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c +++ b/keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c @@ -127,17 +127,3 @@ bool rgb_matrix_indicators_kb(void) { return true; } #endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/latincompass/latinpadble/latinpadble.c b/keyboards/latincompass/latinpadble/latinpadble.c index cce96241b6dc..a6cd6784e137 100644 --- a/keyboards/latincompass/latinpadble/latinpadble.c +++ b/keyboards/latincompass/latinpadble/latinpadble.c @@ -14,13 +14,3 @@ * along with this program. If not, see . */ #include "latinpadble.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - return true; -} diff --git a/keyboards/ll3macorn/bongopad/bongopad.c b/keyboards/ll3macorn/bongopad/bongopad.c index 42a8a199cbb3..a53c7e9fbef6 100644 --- a/keyboards/ll3macorn/bongopad/bongopad.c +++ b/keyboards/ll3macorn/bongopad/bongopad.c @@ -2,22 +2,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "bongopad.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - // rest fo the code - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - return true; -} -#endif - #ifdef OLED_ENABLE bool oled_task_kb(void) { if (!oled_task_user()) { diff --git a/keyboards/lpad/lpad.c b/keyboards/lpad/lpad.c deleted file mode 100644 index 214dd2e390ce..000000000000 --- a/keyboards/lpad/lpad.c +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2023 Laneware Peripherals -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} -#endif diff --git a/keyboards/lw67/lw67.c b/keyboards/lw67/lw67.c index 87eaa1671e92..87f69e9df51b 100644 --- a/keyboards/lw67/lw67.c +++ b/keyboards/lw67/lw67.c @@ -15,16 +15,3 @@ */ #include "lw67.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return false; -} - diff --git a/keyboards/lw75/lw75.c b/keyboards/lw75/lw75.c index 110a26ce1a40..1ec684151524 100644 --- a/keyboards/lw75/lw75.c +++ b/keyboards/lw75/lw75.c @@ -2,18 +2,3 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "lw75.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} -#endif - diff --git a/keyboards/lyso1/lck75/lck75.c b/keyboards/lyso1/lck75/lck75.c index 55650681ac79..edaaf3feb14f 100644 --- a/keyboards/lyso1/lck75/lck75.c +++ b/keyboards/lyso1/lck75/lck75.c @@ -14,18 +14,6 @@ */ #include "lck75.h" -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} - #define IDLE_FRAMES 5 #define IDLE_SPEED 30 #define TAP_FRAMES 2 diff --git a/keyboards/macro1/macro1.c b/keyboards/macro1/macro1.c index f1fbed1d1507..a9cba4ecfa11 100644 --- a/keyboards/macro1/macro1.c +++ b/keyboards/macro1/macro1.c @@ -14,18 +14,3 @@ * along with this program. If not, see . */ #include "macro1.h" - - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return false; -} diff --git a/keyboards/mechwild/bde/rev2/rev2.c b/keyboards/mechwild/bde/rev2/rev2.c index d89f2f193846..3d8314402481 100644 --- a/keyboards/mechwild/bde/rev2/rev2.c +++ b/keyboards/mechwild/bde/rev2/rev2.c @@ -16,22 +16,6 @@ #include "quantum.h" -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif - #ifdef OLED_ENABLE static const char PROGMEM mw_logo[] = { 0x8A, 0x8B, 0x8C, 0x8D, '\r', diff --git a/keyboards/mechwild/mercutio/mercutio.c b/keyboards/mechwild/mercutio/mercutio.c index 890bf869dede..c0369397d1b0 100755 --- a/keyboards/mechwild/mercutio/mercutio.c +++ b/keyboards/mechwild/mercutio/mercutio.c @@ -17,25 +17,6 @@ #include "mercutio.h" -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if(!encoder_update_user(index, clockwise)) { - return false; - } - - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif - #ifdef OLED_ENABLE static const char PROGMEM mercutio_name[] = { 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0x95, 0xB5, 0x96, 0xD5, 0xB6, 0xB6, diff --git a/keyboards/mechwild/obe/obe.c b/keyboards/mechwild/obe/obe.c index 195d4a76790d..548f95582583 100644 --- a/keyboards/mechwild/obe/obe.c +++ b/keyboards/mechwild/obe/obe.c @@ -15,19 +15,3 @@ */ #include "obe.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif diff --git a/keyboards/mechwild/waka60/waka60.c b/keyboards/mechwild/waka60/waka60.c index 180d0a67865d..f0c5f143e433 100644 --- a/keyboards/mechwild/waka60/waka60.c +++ b/keyboards/mechwild/waka60/waka60.c @@ -15,19 +15,3 @@ */ #include "waka60.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif diff --git a/keyboards/meletrix/zoom65/zoom65.c b/keyboards/meletrix/zoom65/zoom65.c index 7e8c6511bb27..11f49a9060ff 100644 --- a/keyboards/meletrix/zoom65/zoom65.c +++ b/keyboards/meletrix/zoom65/zoom65.c @@ -61,10 +61,4 @@ bool encoder_update_kb(uint8_t index, bool clockwise) encoder_action_register(index, clockwise); return true; }; -#else -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - tap_code_delay(clockwise ? KC_VOLU : KC_VOLD, 10); - return true; -} #endif diff --git a/keyboards/meletrix/zoom65_lite/zoom65_lite.c b/keyboards/meletrix/zoom65_lite/zoom65_lite.c index 1e1100a20735..b0b511f6866a 100644 --- a/keyboards/meletrix/zoom65_lite/zoom65_lite.c +++ b/keyboards/meletrix/zoom65_lite/zoom65_lite.c @@ -15,11 +15,3 @@ */ #include "zoom65_lite.h" - -#ifndef VIA_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - tap_code_delay(clockwise ? KC_VOLU : KC_VOLD, 10); - return true; -} -#endif diff --git a/keyboards/metamechs/timberwolf/timberwolf.c b/keyboards/metamechs/timberwolf/timberwolf.c index ff5085124747..f21c0daa07f3 100644 --- a/keyboards/metamechs/timberwolf/timberwolf.c +++ b/keyboards/metamechs/timberwolf/timberwolf.c @@ -23,13 +23,3 @@ void led_update_ports(led_t led_state) { backlight_set(0); } } - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} diff --git a/keyboards/mini_elixivy/mini_elixivy.c b/keyboards/mini_elixivy/mini_elixivy.c index a8d9c931c2e2..2d6f1ea62327 100644 --- a/keyboards/mini_elixivy/mini_elixivy.c +++ b/keyboards/mini_elixivy/mini_elixivy.c @@ -15,14 +15,3 @@ */ #include "mini_elixivy.h" - -/* Rotary Encoder's function (currently volume up/down) */ -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} diff --git a/keyboards/mk65/mk65.c b/keyboards/mk65/mk65.c deleted file mode 100644 index b05174eacdc3..000000000000 --- a/keyboards/mk65/mk65.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2022 DeskDaily - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/mwstudio/alicekk/alicekk.c b/keyboards/mwstudio/alicekk/alicekk.c index 96c468066ab4..e8ab40b2b9f6 100644 --- a/keyboards/mwstudio/alicekk/alicekk.c +++ b/keyboards/mwstudio/alicekk/alicekk.c @@ -14,17 +14,3 @@ * along with this program. If not, see . */ #include "alicekk.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/mwstudio/mw80/mw80.c b/keyboards/mwstudio/mw80/mw80.c deleted file mode 100644 index e402f305ec55..000000000000 --- a/keyboards/mwstudio/mw80/mw80.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2022 TW59420 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/nullbitsco/snap/snap.c b/keyboards/nullbitsco/snap/snap.c index 1ec6e5cf0095..c1005bc623a4 100644 --- a/keyboards/nullbitsco/snap/snap.c +++ b/keyboards/nullbitsco/snap/snap.c @@ -111,17 +111,3 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return true; } - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/onekeyco/dango40/dango40.c b/keyboards/onekeyco/dango40/dango40.c index 8ca77545bf47..2df82b0aa1b8 100644 --- a/keyboards/onekeyco/dango40/dango40.c +++ b/keyboards/onekeyco/dango40/dango40.c @@ -15,13 +15,3 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "dango40.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - return true; -} diff --git a/keyboards/orthocode/orthocode.c b/keyboards/orthocode/orthocode.c index 8ddd32c39604..1bfc431c7879 100644 --- a/keyboards/orthocode/orthocode.c +++ b/keyboards/orthocode/orthocode.c @@ -44,16 +44,3 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { } return true; } - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - // Volume control - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} -#endif diff --git a/keyboards/pauperboards/brick/brick.c b/keyboards/pauperboards/brick/brick.c deleted file mode 100644 index 13df995e544f..000000000000 --- a/keyboards/pauperboards/brick/brick.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2023 Jason Chestnut @pauperboards - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} -#endif diff --git a/keyboards/pearlboards/atlas/atlas.c b/keyboards/pearlboards/atlas/atlas.c index ff8577bde16c..d8fcc8abb9e4 100644 --- a/keyboards/pearlboards/atlas/atlas.c +++ b/keyboards/pearlboards/atlas/atlas.c @@ -15,17 +15,3 @@ */ #include "atlas.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/pearlboards/pandora/pandora.c b/keyboards/pearlboards/pandora/pandora.c index 608ee00edf1b..927f29f2f31a 100644 --- a/keyboards/pearlboards/pandora/pandora.c +++ b/keyboards/pearlboards/pandora/pandora.c @@ -16,24 +16,6 @@ #include "pandora.h" -// Encoder rotate function -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - /* First encoder */ - if (index == 0) { - if (clockwise) { - tap_code(KC_AUDIO_VOL_UP); - } else { - tap_code(KC_AUDIO_VOL_DOWN); - } - } - return true; -} -#endif - // Encoder click function #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/pearlboards/zeus/zeus.c b/keyboards/pearlboards/zeus/zeus.c index cdb8d6125d27..b6a7fe1f8e8b 100644 --- a/keyboards/pearlboards/zeus/zeus.c +++ b/keyboards/pearlboards/zeus/zeus.c @@ -15,20 +15,3 @@ */ #include "zeus.h" - -// Encoder rotate function -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } /* First encoder */ - if (index == 0) { - if (clockwise) { - tap_code(KC_AUDIO_VOL_UP); - } else { - tap_code(KC_AUDIO_VOL_DOWN); - } - } - return true; -} -#endif diff --git a/keyboards/pearlboards/zeuspad/zeuspad.c b/keyboards/pearlboards/zeuspad/zeuspad.c index 3f7367fb497a..ffa504fa63ec 100644 --- a/keyboards/pearlboards/zeuspad/zeuspad.c +++ b/keyboards/pearlboards/zeuspad/zeuspad.c @@ -16,24 +16,6 @@ #include "zeuspad.h" -// Encoder rotate function -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - /* First encoder */ - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_AUDIO_VOL_UP, 10); - } else { - tap_code_delay(KC_AUDIO_VOL_DOWN, 10); - } - } - return true; -} -#endif - // 21 characters max #ifdef OLED_ENABLE bool oled_task_kb(void) { diff --git a/keyboards/pica40/rev1/rev1.c b/keyboards/pica40/rev1/rev1.c index f008e4857a1d..f8a03dde3b1e 100644 --- a/keyboards/pica40/rev1/rev1.c +++ b/keyboards/pica40/rev1/rev1.c @@ -77,15 +77,3 @@ bool oled_task_kb(void) { } #endif // OLED_ENABLE - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - - tap_code(clockwise ? KC_VOLU : KC_VOLD); - - return false; -} - -#endif // ENCODER_ENABLE diff --git a/keyboards/program_yoink/program_yoink.c b/keyboards/program_yoink/program_yoink.c deleted file mode 100644 index d1373a52833b..000000000000 --- a/keyboards/program_yoink/program_yoink.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2020 melonbred - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/rart/rart75hs/rart75hs.c b/keyboards/rart/rart75hs/rart75hs.c index 6c1c408a8b96..58f43c87e3e4 100644 --- a/keyboards/rart/rart75hs/rart75hs.c +++ b/keyboards/rart/rart75hs/rart75hs.c @@ -13,19 +13,3 @@ * along with this program. If not, see . */ #include "rart75hs.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/rart/rart75m/rart75m.c b/keyboards/rart/rart75m/rart75m.c index 87a12a9a1f78..7c9014386ef0 100644 --- a/keyboards/rart/rart75m/rart75m.c +++ b/keyboards/rart/rart75m/rart75m.c @@ -14,22 +14,6 @@ */ #include "rart75m.h" -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif - #ifdef OLED_ENABLE bool oled_task_kb(void) { if (!oled_task_user()) { diff --git a/keyboards/rart/rartland/rartland.c b/keyboards/rart/rartland/rartland.c index e4a555d1282f..da4be6ac8caf 100644 --- a/keyboards/rart/rartland/rartland.c +++ b/keyboards/rart/rartland/rartland.c @@ -14,22 +14,6 @@ */ #include "rartland.h" -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif - #ifdef OLED_ENABLE bool oled_task_kb(void) { if (!oled_task_user()) { diff --git a/keyboards/reedskeebs/alish40/alish40.c b/keyboards/reedskeebs/alish40/alish40.c deleted file mode 100644 index 685eae8de8d0..000000000000 --- a/keyboards/reedskeebs/alish40/alish40.c +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 QMK Contributors (@qmk) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - } - return true; -} -#endif diff --git a/keyboards/ristretto/ristretto.c b/keyboards/ristretto/ristretto.c index b73e5043c33e..d004b3dffe34 100644 --- a/keyboards/ristretto/ristretto.c +++ b/keyboards/ristretto/ristretto.c @@ -23,18 +23,6 @@ enum layers { _ADJUST }; -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if(index == 0) { - if (clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - } - return true; -} - #ifdef OLED_ENABLE oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return OLED_ROTATION_270; diff --git a/keyboards/rmkeebs/rm_numpad/rm_numpad.c b/keyboards/rmkeebs/rm_numpad/rm_numpad.c deleted file mode 100644 index 0152566bd13b..000000000000 --- a/keyboards/rmkeebs/rm_numpad/rm_numpad.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2021 RuckerMachine - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/rotr/rotr.c b/keyboards/rotr/rotr.c index b7c551075d27..8df10909f6ba 100644 --- a/keyboards/rotr/rotr.c +++ b/keyboards/rotr/rotr.c @@ -1,11 +1 @@ #include "rotr.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} diff --git a/keyboards/rubi/rubi.c b/keyboards/rubi/rubi.c index 50e5fcf78278..b125ff34a5e8 100644 --- a/keyboards/rubi/rubi.c +++ b/keyboards/rubi/rubi.c @@ -72,8 +72,3 @@ bool led_update_kb(led_t led_state) { } return true; } - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - return true; -} diff --git a/keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.c b/keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.c index 8fd9a2fa141e..824e7364be3c 100644 --- a/keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.c +++ b/keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.c @@ -15,17 +15,3 @@ */ #include "hotswap.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/sneakbox/aliceclonergb/aliceclonergb.c b/keyboards/sneakbox/aliceclonergb/aliceclonergb.c index e2136312d341..62d0118cf97b 100644 --- a/keyboards/sneakbox/aliceclonergb/aliceclonergb.c +++ b/keyboards/sneakbox/aliceclonergb/aliceclonergb.c @@ -16,17 +16,3 @@ along with this program. If not, see . */ #include "aliceclonergb.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index,clockwise)) { return false; } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_DOWN); - } else { - tap_code(KC_UP); - } - } - return true; -} -#endif diff --git a/keyboards/spacey/spacey.c b/keyboards/spacey/spacey.c index 32f1e4dd9c07..a83f1f8990ca 100644 --- a/keyboards/spacey/spacey.c +++ b/keyboards/spacey/spacey.c @@ -15,15 +15,3 @@ */ #include "spacey.h" - -bool encoder_update_kb(uint8_t index, bool clockwise){ - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if(clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - } - return true; -} diff --git a/keyboards/sthlmkb/litl/litl.c b/keyboards/sthlmkb/litl/litl.c index 40aedfbe278d..230d4db52a09 100644 --- a/keyboards/sthlmkb/litl/litl.c +++ b/keyboards/sthlmkb/litl/litl.c @@ -14,17 +14,3 @@ * along with this program. If not, see . */ #include "litl.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/taleguers/taleguers75/taleguers75.c b/keyboards/taleguers/taleguers75/taleguers75.c index 97664effde04..b51d9443bc25 100644 --- a/keyboards/taleguers/taleguers75/taleguers75.c +++ b/keyboards/taleguers/taleguers75/taleguers75.c @@ -15,14 +15,3 @@ */ #include "taleguers75.h" - - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (!clockwise) { - tap_code(KC_AUDIO_VOL_DOWN); - } else { - tap_code(KC_AUDIO_VOL_UP); - } - return true; -} diff --git a/keyboards/tau4/tau4.c b/keyboards/tau4/tau4.c index aa508aae2c5a..c93d73f2b4f1 100644 --- a/keyboards/tau4/tau4.c +++ b/keyboards/tau4/tau4.c @@ -17,20 +17,6 @@ along with this program. If not, see . #include "quantum.h" -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} -#endif - #ifdef OLED_ENABLE bool oled_task_kb(void) { if (!oled_task_user()) { return false; } diff --git a/keyboards/thepanduuh/degenpad/degenpad.c b/keyboards/thepanduuh/degenpad/degenpad.c deleted file mode 100644 index e28254480e36..000000000000 --- a/keyboards/thepanduuh/degenpad/degenpad.c +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2023 ThePanduuh - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/tkc/portico75/portico75.c b/keyboards/tkc/portico75/portico75.c index 299af2f30598..568f75901f0d 100644 --- a/keyboards/tkc/portico75/portico75.c +++ b/keyboards/tkc/portico75/portico75.c @@ -171,19 +171,3 @@ bool rgb_matrix_indicators_kb(void) { return true; } #endif - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/tominabox1/bigboy/bigboy.c b/keyboards/tominabox1/bigboy/bigboy.c deleted file mode 100755 index 6871d81a625e..000000000000 --- a/keyboards/tominabox1/bigboy/bigboy.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2022 tominabox1 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif /* ENCODER_ENABLE */ diff --git a/keyboards/ungodly/nines/nines.c b/keyboards/ungodly/nines/nines.c deleted file mode 100644 index bfb3bb889dd7..000000000000 --- a/keyboards/ungodly/nines/nines.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2020 Ungodly Design - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - #include "quantum.h" - -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) return false; - if (index == 0) { /* Left encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } else if (index == 1) { /* Right encoder */ - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} diff --git a/keyboards/viendi8l/viendi8l.c b/keyboards/viendi8l/viendi8l.c index 6d529933422a..4d0257f0dda7 100644 --- a/keyboards/viendi8l/viendi8l.c +++ b/keyboards/viendi8l/viendi8l.c @@ -39,14 +39,3 @@ layer_state_t layer_state_set_kb(layer_state_t state) { } return state; } - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if(!encoder_update_user(index, clockwise)) return false; - if (index == 0) { - if (clockwise) tap_code_delay(KC_VOLU, 10); - else tap_code_delay(KC_VOLD, 10); - } - return true; -} -#endif diff --git a/keyboards/work_louder/work_board/work_board.c b/keyboards/work_louder/work_board/work_board.c index 928a8abd8959..157504216df5 100644 --- a/keyboards/work_louder/work_board/work_board.c +++ b/keyboards/work_louder/work_board/work_board.c @@ -16,20 +16,6 @@ #include "work_board.h" -#if defined(ENCODER_ENABLE) -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - if (clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - return true; -} -#endif - #ifdef OLED_ENABLE # ifdef RGB_MATRIX_ENABLE # error Cannot run OLED and Per Key RGB at the same time due to pin conflicts diff --git a/keyboards/wuque/mammoth75x/mammoth75x.c b/keyboards/wuque/mammoth75x/mammoth75x.c index 945219575210..21dcf1e67d18 100644 --- a/keyboards/wuque/mammoth75x/mammoth75x.c +++ b/keyboards/wuque/mammoth75x/mammoth75x.c @@ -61,10 +61,4 @@ bool encoder_update_kb(uint8_t index, bool clockwise) encoder_action_register(index, clockwise); return true; }; -#else -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - tap_code_delay(clockwise ? KC_VOLU : KC_VOLD, 10); - return true; -} #endif diff --git a/keyboards/wuque/serneity65/serneity65.c b/keyboards/wuque/serneity65/serneity65.c index ff03a3ca5fa8..9bc4ab28affe 100644 --- a/keyboards/wuque/serneity65/serneity65.c +++ b/keyboards/wuque/serneity65/serneity65.c @@ -61,15 +61,4 @@ bool encoder_update_kb(uint8_t index, bool clockwise) encoder_action_register(index, clockwise); return true; }; -#else -bool encoder_update_user(uint8_t index, bool clockwise) { - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } - return true; -} #endif diff --git a/keyboards/z12/z12.c b/keyboards/z12/z12.c deleted file mode 100644 index 3edc9128e40c..000000000000 --- a/keyboards/z12/z12.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2020 Sergi Meseguer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "quantum.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - return encoder_update_user(index, clockwise); -} -#endif diff --git a/quantum/encoder.c b/quantum/encoder.c index 8053913e8d85..1046fe6cc3d2 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -77,7 +77,29 @@ __attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { } __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { - return encoder_update_user(index, clockwise); + bool res = encoder_update_user(index, clockwise); +#if !defined(ENCODER_TESTS) + if (res) { + if (clockwise) { +# if defined(EXTRAKEY_ENABLE) + tap_code_delay(KC_VOLU, 10); +# elif defined(MOUSEKEY_ENABLE) + tap_code_delay(KC_MS_WH_UP, 10); +# else + tap_code_delay(KC_PGDN, 10); +# endif + } else { +# if defined(EXTRAKEY_ENABLE) + tap_code_delay(KC_VOLD, 10); +# elif defined(MOUSEKEY_ENABLE) + tap_code_delay(KC_MS_WH_DOWN, 10); +# else + tap_code_delay(KC_PGUP, 10); +# endif + } + } +#endif // ENCODER_TESTS + return res; } __attribute__((weak)) bool should_process_encoder(void) {