Add core/fallback encoder behaviour (#20320)

master
jack 2 years ago committed by GitHub
parent 7e48a4e80f
commit 36ab0c0aaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      docs/feature_encoders.md
  2. 11
      keyboards/acheron/shark/beta/beta.c
  3. 14
      keyboards/adafruit/macropad/macropad.c
  4. 15
      keyboards/aidansmithdotdev/fine40/fine40.c
  5. 12
      keyboards/anavi/knob1/knob1.c
  6. 16
      keyboards/anavi/macropad10/macropad10.c
  7. 24
      keyboards/ano/ano.c
  8. 17
      keyboards/atlantis/ps17/ps17.c
  9. 14
      keyboards/bolsa/damapad/damapad.c
  10. 10
      keyboards/cannonkeys/balance/balance.c
  11. 14
      keyboards/cannonkeys/ortho60v2/ortho60v2.c
  12. 29
      keyboards/checkerboards/phoenix45_ortho/phoenix45_ortho.c
  13. 29
      keyboards/checkerboards/quark/quark.c
  14. 12
      keyboards/checkerboards/quark_squared/quark_squared.c
  15. 16
      keyboards/chocofly/chocofly.c
  16. 12
      keyboards/ck60i/ck60i.c
  17. 29
      keyboards/coban/pad3a/pad3a.c
  18. 27
      keyboards/crbn/crbn.c
  19. 38
      keyboards/custommk/genesis/rev1/rev1.c
  20. 39
      keyboards/custommk/genesis/rev2/rev2.c
  21. 12
      keyboards/drhigsby/packrat/packrat.c
  22. 13
      keyboards/drop/sense75/sense75.c
  23. 19
      keyboards/dumbpad/v3x/v3x.c
  24. 10
      keyboards/evolv/evolv.c
  25. 14
      keyboards/eyeohdesigns/sprh/sprh.c
  26. 14
      keyboards/eyeohdesigns/theboulevard/theboulevard.c
  27. 11
      keyboards/ffkeebs/puca/puca.c
  28. 21
      keyboards/geistmaschine/geist/geist.c
  29. 21
      keyboards/geistmaschine/macropod/macropod.c
  30. 14
      keyboards/gmmk/numpad/numpad.c
  31. 30
      keyboards/gmmk/pro/pro.c
  32. 12
      keyboards/gorthage_truck/gorthage_truck.c
  33. 19
      keyboards/handwired/daskeyboard/daskeyboard4/daskeyboard4.c
  34. 33
      keyboards/handwired/maverick0197/keydeck8/keydeck8.c
  35. 11
      keyboards/handwired/swiftrax/bumblebee/bumblebee.c
  36. 14
      keyboards/handwired/swiftrax/digicarp65/digicarp65.c
  37. 14
      keyboards/handwired/tsubasa/tsubasa.c
  38. 14
      keyboards/io_mini1800/io_mini1800.c
  39. 10
      keyboards/jagdpietr/drakon/drakon.c
  40. 12
      keyboards/jkeys_design/gentleman65/gentleman65.c
  41. 14
      keyboards/jkeys_design/gentleman65_se_s/gentleman65_se_s.c
  42. 10
      keyboards/kapcave/arya/arya.c
  43. 12
      keyboards/keebio/dsp40/rev1/rev1.c
  44. 12
      keyboards/keebsforall/coarse60/coarse60.c
  45. 28
      keyboards/keebsforall/freebirdnp/pro/pro.c
  46. 14
      keyboards/keychron/v10/v10.c
  47. 14
      keyboards/keychron/v6/v6.c
  48. 6
      keyboards/keyprez/rhino/rhino.c
  49. 14
      keyboards/keyprez/unicorn/unicorn.c
  50. 28
      keyboards/keystonecaps/gameroyadvance/gameroyadvance.c
  51. 12
      keyboards/kiwikeebs/macro/macro.c
  52. 12
      keyboards/kiwikeebs/macro_v2/macro_v2.c
  53. 14
      keyboards/kiwikey/borderland/borderland.c
  54. 14
      keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c
  55. 14
      keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c
  56. 10
      keyboards/latincompass/latinpadble/latinpadble.c
  57. 16
      keyboards/ll3macorn/bongopad/bongopad.c
  58. 18
      keyboards/lpad/lpad.c
  59. 13
      keyboards/lw67/lw67.c
  60. 15
      keyboards/lw75/lw75.c
  61. 12
      keyboards/lyso1/lck75/lck75.c
  62. 15
      keyboards/macro1/macro1.c
  63. 16
      keyboards/mechwild/bde/rev2/rev2.c
  64. 19
      keyboards/mechwild/mercutio/mercutio.c
  65. 16
      keyboards/mechwild/obe/obe.c
  66. 16
      keyboards/mechwild/waka60/waka60.c
  67. 6
      keyboards/meletrix/zoom65/zoom65.c
  68. 8
      keyboards/meletrix/zoom65_lite/zoom65_lite.c
  69. 10
      keyboards/metamechs/timberwolf/timberwolf.c
  70. 11
      keyboards/mini_elixivy/mini_elixivy.c
  71. 31
      keyboards/mk65/mk65.c
  72. 14
      keyboards/mwstudio/alicekk/alicekk.c
  73. 31
      keyboards/mwstudio/mw80/mw80.c
  74. 14
      keyboards/nullbitsco/snap/snap.c
  75. 10
      keyboards/onekeyco/dango40/dango40.c
  76. 13
      keyboards/orthocode/orthocode.c
  77. 31
      keyboards/pauperboards/brick/brick.c
  78. 14
      keyboards/pearlboards/atlas/atlas.c
  79. 18
      keyboards/pearlboards/pandora/pandora.c
  80. 17
      keyboards/pearlboards/zeus/zeus.c
  81. 18
      keyboards/pearlboards/zeuspad/zeuspad.c
  82. 12
      keyboards/pica40/rev1/rev1.c
  83. 29
      keyboards/program_yoink/program_yoink.c
  84. 16
      keyboards/rart/rart75hs/rart75hs.c
  85. 16
      keyboards/rart/rart75m/rart75m.c
  86. 16
      keyboards/rart/rartland/rartland.c
  87. 22
      keyboards/reedskeebs/alish40/alish40.c
  88. 12
      keyboards/ristretto/ristretto.c
  89. 31
      keyboards/rmkeebs/rm_numpad/rm_numpad.c
  90. 10
      keyboards/rotr/rotr.c
  91. 5
      keyboards/rubi/rubi.c
  92. 14
      keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.c
  93. 14
      keyboards/sneakbox/aliceclonergb/aliceclonergb.c
  94. 12
      keyboards/spacey/spacey.c
  95. 14
      keyboards/sthlmkb/litl/litl.c
  96. 11
      keyboards/taleguers/taleguers75/taleguers75.c
  97. 14
      keyboards/tau4/tau4.c
  98. 31
      keyboards/thepanduuh/degenpad/degenpad.c
  99. 16
      keyboards/tkc/portico75/portico75.c
  100. 31
      keyboards/tominabox1/bigboy/bigboy.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -102,9 +102,9 @@ Using encoder mapping pumps events through the normal QMK keycode processing pip
## Callbacks ## Callbacks
When not using `ENCODER_MAP_ENABLE = yes`, the callback functions can be inserted into your `<keyboard>.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 (`<keyboard>.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 `<keyboard>.c`:
```c ```c
bool encoder_update_kb(uint8_t index, bool clockwise) { 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 (index == 0) { /* First encoder */
if (clockwise) { if (clockwise) {
tap_code_delay(KC_VOLU, 10); tap_code(KC_PGDN);
} else { } else {
tap_code_delay(KC_VOLD, 10); tap_code(KC_PGUP);
} }
} else if (index == 1) { /* Second encoder */ } else if (index == 1) { /* Second encoder */
if (clockwise) { if (clockwise) {
@ -134,9 +134,9 @@ or `keymap.c`:
bool encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */ if (index == 0) { /* First encoder */
if (clockwise) { if (clockwise) {
tap_code_delay(KC_VOLU, 10); tap_code(KC_PGDN);
} else { } else {
tap_code_delay(KC_VOLD, 10); tap_code(KC_PGUP);
} }
} else if (index == 1) { /* Second encoder */ } else if (index == 1) { /* Second encoder */
if (clockwise) { 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 ## Hardware

@ -20,14 +20,3 @@ void board_init(void) {
setPinInput(B6); setPinInput(B6);
setPinInput(B7); 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

@ -40,17 +40,3 @@ led_config_t g_led_config = { {
} }; } };
#endif #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

@ -68,18 +68,3 @@ bool oled_task_kb(void) {
return(true); return(true);
} }
#endif #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

@ -14,18 +14,6 @@ void keyboard_post_init_kb(void) {
keyboard_post_init_user(); 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 #ifdef OLED_ENABLE
bool oled_task_kb(void) { bool oled_task_kb(void) {

@ -1,16 +0,0 @@
// Copyright 2022 Leon Anavi <leon@anavi.org>
// 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

@ -15,27 +15,3 @@
*/ */
#include "ano.h" #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

@ -19,23 +19,6 @@ void keyboard_pre_init_kb(void) {
keyboard_pre_init_user(); 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 #ifdef RGB_MATRIX_ENABLE
void suspend_power_down_kb(void) { void suspend_power_down_kb(void) {
/* Disable indicator LEDs when going to sleep */ /* Disable indicator LEDs when going to sleep */

@ -65,17 +65,3 @@ oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
return OLED_ROTATION_180; return OLED_ROTATION_180;
} }
#endif #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

@ -15,13 +15,3 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "balance.h" #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;
}

@ -15,17 +15,3 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "ortho60v2.h" #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

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

@ -15,15 +15,3 @@
*/ */
#include "quark_squared.h" #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;
}

@ -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

@ -16,15 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "ck60i.h" #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;
}

@ -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 <http://www.gnu.org/licenses/>.
*/
#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

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

@ -14,15 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "packrat.h" #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;
}

@ -133,16 +133,3 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = {
{ 1, H_16, G_16, I_16 } { 1, H_16, G_16, I_16 }
}; };
#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(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return false;
}
#endif

@ -100,22 +100,3 @@ bool led_update_kb(led_t led_state) {
writePin(LED_02, !led_state.num_lock); writePin(LED_02, !led_state.num_lock);
return true; 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

@ -16,13 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "evolv.h" #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;
}

@ -14,17 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "sprh.h" #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

@ -15,17 +15,3 @@
*/ */
#include "theboulevard.h" #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

@ -29,17 +29,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
return true; 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 // OLED
#ifdef OLED_ENABLE #ifdef OLED_ENABLE
__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } __attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; }

@ -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

@ -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

@ -120,17 +120,3 @@ void keyboard_pre_init_user(void) {
# endif # endif
#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

@ -1,30 +0,0 @@
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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

@ -15,15 +15,3 @@
*/ */
#include "gorthage_truck.h" #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;
}

@ -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

@ -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 <http://www.gnu.org/licenses/>.
*/
#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

@ -16,17 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "bumblebee.h" #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' // Initialize all RGB indicators to 'off'
void keyboard_post_init_kb(void) { void keyboard_post_init_kb(void) {
rgblight_setrgb_at(0, 0, 0, 0); // [..., 0] = top LED rgblight_setrgb_at(0, 0, 0, 0); // [..., 0] = top LED

@ -15,17 +15,3 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "digicarp65.h" #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

@ -16,20 +16,6 @@
#include "tsubasa.h" #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 #ifdef OLED_ENABLE
static void render_scrl(void) { static void render_scrl(void) {
static const char PROGMEM raw_scrl[] = { static const char PROGMEM raw_scrl[] = {

@ -2,17 +2,3 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "io_mini1800.h" #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

@ -18,16 +18,6 @@
char wpm_str[10]; 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 #ifdef OLED_ENABLE
// Defines names for use in layer keycodes and the keymap // Defines names for use in layer keycodes and the keymap

@ -16,15 +16,3 @@
*/ */
#include "gentleman65.h" #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;
}

@ -16,17 +16,3 @@
*/ */
#include "gentleman65_se_s.h" #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

@ -15,13 +15,3 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "arya.h" #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;
}

@ -24,15 +24,3 @@ void eeconfig_init_kb(void) {
eeconfig_update_kb(0); eeconfig_update_kb(0);
eeconfig_init_user(); 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;
}

@ -15,15 +15,3 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "coarse60.h" #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;
}

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

@ -84,17 +84,3 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
} }
#endif // CAPS_LOCK_LED_INDEX #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

@ -98,17 +98,3 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
} }
#endif // RGB_MATRIX_ENABLE... #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

@ -17,12 +17,6 @@
#include "quantum.h" #include "quantum.h"
#include QMK_KEYBOARD_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)) __attribute__ ((weak))
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_2x2u( const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_2x2u(
0, 0,

@ -2,17 +2,3 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "unicorn.h" #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

@ -16,31 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "gameroyadvance.h" #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

@ -15,15 +15,3 @@
*/ */
#include "macro.h" #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;
}

@ -15,15 +15,3 @@
*/ */
#include "macro_v2.h" #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;
}

@ -2,17 +2,3 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "borderland.h" #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

@ -57,17 +57,3 @@ bool rgb_matrix_indicators_kb(void) {
} }
return true; 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

@ -127,17 +127,3 @@ bool rgb_matrix_indicators_kb(void) {
return true; return true;
} }
#endif #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

@ -14,13 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "latinpadble.h" #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;
}

@ -2,22 +2,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "bongopad.h" #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 #ifdef OLED_ENABLE
bool oled_task_kb(void) { bool oled_task_kb(void) {
if (!oled_task_user()) { if (!oled_task_user()) {

@ -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

@ -15,16 +15,3 @@
*/ */
#include "lw67.h" #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;
}

@ -2,18 +2,3 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include "lw75.h" #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

@ -14,18 +14,6 @@
*/ */
#include "lck75.h" #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_FRAMES 5
#define IDLE_SPEED 30 #define IDLE_SPEED 30
#define TAP_FRAMES 2 #define TAP_FRAMES 2

@ -14,18 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "macro1.h" #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;
}

@ -16,22 +16,6 @@
#include "quantum.h" #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 #ifdef OLED_ENABLE
static const char PROGMEM mw_logo[] = { static const char PROGMEM mw_logo[] = {
0x8A, 0x8B, 0x8C, 0x8D, '\r', 0x8A, 0x8B, 0x8C, 0x8D, '\r',

@ -17,25 +17,6 @@
#include "mercutio.h" #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 #ifdef OLED_ENABLE
static const char PROGMEM mercutio_name[] = { 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, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0x95, 0xB5, 0x96, 0xD5, 0xB6, 0xB6,

@ -15,19 +15,3 @@
*/ */
#include "obe.h" #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

@ -15,19 +15,3 @@
*/ */
#include "waka60.h" #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

@ -61,10 +61,4 @@ bool encoder_update_kb(uint8_t index, bool clockwise)
encoder_action_register(index, clockwise); encoder_action_register(index, clockwise);
return true; 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 #endif

@ -15,11 +15,3 @@
*/ */
#include "zoom65_lite.h" #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

@ -23,13 +23,3 @@ void led_update_ports(led_t led_state) {
backlight_set(0); 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;
}

@ -15,14 +15,3 @@
*/ */
#include "mini_elixivy.h" #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;
}

@ -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 <http://www.gnu.org/licenses/>.
*/
#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

@ -14,17 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "alicekk.h" #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

@ -1,31 +0,0 @@
/* Copyright 2022 TW59420 <https://github.com/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 <http://www.gnu.org/licenses/>.
*/
#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

@ -111,17 +111,3 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return true; 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

@ -15,13 +15,3 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "dango40.h" #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;
}

@ -44,16 +44,3 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
} }
return true; 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

@ -1,31 +0,0 @@
/* Copyright 2023 Jason Chestnut <pauperboards@gmail.com> @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 <http://www.gnu.org/licenses/>.
*/
#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

@ -15,17 +15,3 @@
*/ */
#include "atlas.h" #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

@ -16,24 +16,6 @@
#include "pandora.h" #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 // Encoder click function
#ifdef DIP_SWITCH_ENABLE #ifdef DIP_SWITCH_ENABLE
bool dip_switch_update_kb(uint8_t index, bool active) { bool dip_switch_update_kb(uint8_t index, bool active) {

@ -15,20 +15,3 @@
*/ */
#include "zeus.h" #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

@ -16,24 +16,6 @@
#include "zeuspad.h" #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 // 21 characters max
#ifdef OLED_ENABLE #ifdef OLED_ENABLE
bool oled_task_kb(void) { bool oled_task_kb(void) {

@ -77,15 +77,3 @@ bool oled_task_kb(void) {
} }
#endif // OLED_ENABLE #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

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

@ -13,19 +13,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "rart75hs.h" #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

@ -14,22 +14,6 @@
*/ */
#include "rart75m.h" #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 #ifdef OLED_ENABLE
bool oled_task_kb(void) { bool oled_task_kb(void) {
if (!oled_task_user()) { if (!oled_task_user()) {

@ -14,22 +14,6 @@
*/ */
#include "rartland.h" #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 #ifdef OLED_ENABLE
bool oled_task_kb(void) { bool oled_task_kb(void) {
if (!oled_task_user()) { if (!oled_task_user()) {

@ -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

@ -23,18 +23,6 @@ enum layers {
_ADJUST _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 #ifdef OLED_ENABLE
oled_rotation_t oled_init_kb(oled_rotation_t rotation) { oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
return OLED_ROTATION_270; return OLED_ROTATION_270;

@ -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 <http://www.gnu.org/licenses/>.
*/
#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

@ -1,11 +1 @@
#include "rotr.h" #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;
}

@ -72,8 +72,3 @@ bool led_update_kb(led_t led_state) {
} }
return true; return true;
} }
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; }
return true;
}

@ -15,17 +15,3 @@
*/ */
#include "hotswap.h" #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

@ -16,17 +16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "aliceclonergb.h" #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

@ -15,15 +15,3 @@
*/ */
#include "spacey.h" #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;
}

@ -14,17 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "litl.h" #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

@ -15,14 +15,3 @@
*/ */
#include "taleguers75.h" #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;
}

@ -17,20 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "quantum.h" #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 #ifdef OLED_ENABLE
bool oled_task_kb(void) { bool oled_task_kb(void) {
if (!oled_task_user()) { return false; } if (!oled_task_user()) { return false; }

@ -1,31 +0,0 @@
/*
Copyright 2023 ThePanduuh <thepanduuh.kb@gmail.com>
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 <http://www.gnu.org/licenses/>.
*/
#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

@ -171,19 +171,3 @@ bool rgb_matrix_indicators_kb(void) {
return true; return true;
} }
#endif #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

@ -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 <http://www.gnu.org/licenses/>.
*/
#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 */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save