M docs/feature_encoders.md => docs/feature_encoders.md +7 -7
@@ 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 `<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
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
M keyboards/acheron/shark/beta/beta.c => keyboards/acheron/shark/beta/beta.c +0 -11
@@ 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
M keyboards/adafruit/macropad/macropad.c => keyboards/adafruit/macropad/macropad.c +0 -14
@@ 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
M keyboards/aidansmithdotdev/fine40/fine40.c => keyboards/aidansmithdotdev/fine40/fine40.c +0 -15
@@ 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
M keyboards/anavi/knob1/knob1.c => keyboards/anavi/knob1/knob1.c +0 -12
@@ 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) {
D keyboards/anavi/macropad10/macropad10.c => keyboards/anavi/macropad10/macropad10.c +0 -16
@@ 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
-
M keyboards/ano/ano.c => keyboards/ano/ano.c +0 -24
@@ 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
M keyboards/atlantis/ps17/ps17.c => keyboards/atlantis/ps17/ps17.c +0 -17
@@ 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 */
M keyboards/bolsa/damapad/damapad.c => keyboards/bolsa/damapad/damapad.c +0 -14
@@ 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
M keyboards/cannonkeys/balance/balance.c => keyboards/cannonkeys/balance/balance.c +0 -10
@@ 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/>.
*/
#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;
-}
M keyboards/cannonkeys/ortho60v2/ortho60v2.c => keyboards/cannonkeys/ortho60v2/ortho60v2.c +0 -14
@@ 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/>.
*/
#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
D keyboards/checkerboards/phoenix45_ortho/phoenix45_ortho.c => keyboards/checkerboards/phoenix45_ortho/phoenix45_ortho.c +0 -29
@@ 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;
-}
D keyboards/checkerboards/quark/quark.c => keyboards/checkerboards/quark/quark.c +0 -29
@@ 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;
-}
M keyboards/checkerboards/quark_squared/quark_squared.c => keyboards/checkerboards/quark_squared/quark_squared.c +0 -12
@@ 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;
-}
D keyboards/chocofly/chocofly.c => keyboards/chocofly/chocofly.c +0 -16
@@ 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
M keyboards/ck60i/ck60i.c => keyboards/ck60i/ck60i.c +0 -12
@@ 16,15 16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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;
-}
D keyboards/coban/pad3a/pad3a.c => keyboards/coban/pad3a/pad3a.c +0 -29
@@ 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
D keyboards/crbn/crbn.c => keyboards/crbn/crbn.c +0 -27
@@ 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;
-}
D keyboards/custommk/genesis/rev1/rev1.c => keyboards/custommk/genesis/rev1/rev1.c +0 -38
@@ 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;
-}
D keyboards/custommk/genesis/rev2/rev2.c => keyboards/custommk/genesis/rev2/rev2.c +0 -39
@@ 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;
-}
-
M keyboards/drhigsby/packrat/packrat.c => keyboards/drhigsby/packrat/packrat.c +0 -12
@@ 14,15 14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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;
-}
M keyboards/drop/sense75/sense75.c => keyboards/drop/sense75/sense75.c +0 -13
@@ 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
M keyboards/dumbpad/v3x/v3x.c => keyboards/dumbpad/v3x/v3x.c +0 -19
@@ 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
M keyboards/evolv/evolv.c => keyboards/evolv/evolv.c +0 -10
@@ 16,13 16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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;
-}
M keyboards/eyeohdesigns/sprh/sprh.c => keyboards/eyeohdesigns/sprh/sprh.c +0 -14
@@ 14,17 14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
M keyboards/eyeohdesigns/theboulevard/theboulevard.c => keyboards/eyeohdesigns/theboulevard/theboulevard.c +0 -14
@@ 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
M keyboards/ffkeebs/puca/puca.c => keyboards/ffkeebs/puca/puca.c +0 -11
@@ 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; }
D keyboards/geistmaschine/geist/geist.c => keyboards/geistmaschine/geist/geist.c +0 -21
@@ 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
D keyboards/geistmaschine/macropod/macropod.c => keyboards/geistmaschine/macropod/macropod.c +0 -21
@@ 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
M keyboards/gmmk/numpad/numpad.c => keyboards/gmmk/numpad/numpad.c +0 -14
@@ 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
D keyboards/gmmk/pro/pro.c => keyboards/gmmk/pro/pro.c +0 -30
@@ 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
M keyboards/gorthage_truck/gorthage_truck.c => keyboards/gorthage_truck/gorthage_truck.c +0 -12
@@ 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;
-}
D keyboards/handwired/daskeyboard/daskeyboard4/daskeyboard4.c => keyboards/handwired/daskeyboard/daskeyboard4/daskeyboard4.c +0 -19
@@ 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
D keyboards/handwired/maverick0197/keydeck8/keydeck8.c => keyboards/handwired/maverick0197/keydeck8/keydeck8.c +0 -33
@@ 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
M keyboards/handwired/swiftrax/bumblebee/bumblebee.c => keyboards/handwired/swiftrax/bumblebee/bumblebee.c +0 -11
@@ 16,17 16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
M keyboards/handwired/swiftrax/digicarp65/digicarp65.c => keyboards/handwired/swiftrax/digicarp65/digicarp65.c +0 -14
@@ 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/>.
*/
#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
M keyboards/handwired/tsubasa/tsubasa.c => keyboards/handwired/tsubasa/tsubasa.c +0 -14
@@ 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[] = {
M keyboards/io_mini1800/io_mini1800.c => keyboards/io_mini1800/io_mini1800.c +0 -14
@@ 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
M keyboards/jagdpietr/drakon/drakon.c => keyboards/jagdpietr/drakon/drakon.c +0 -10
@@ 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
M keyboards/jkeys_design/gentleman65/gentleman65.c => keyboards/jkeys_design/gentleman65/gentleman65.c +0 -12
@@ 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
M keyboards/jkeys_design/gentleman65_se_s/gentleman65_se_s.c => keyboards/jkeys_design/gentleman65_se_s/gentleman65_se_s.c +0 -14
@@ 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
M keyboards/kapcave/arya/arya.c => keyboards/kapcave/arya/arya.c +0 -10
@@ 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/>.
*/
#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;
-}
M keyboards/keebio/dsp40/rev1/rev1.c => keyboards/keebio/dsp40/rev1/rev1.c +0 -12
@@ 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;
-}
M keyboards/keebsforall/coarse60/coarse60.c => keyboards/keebsforall/coarse60/coarse60.c +0 -12
@@ 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/>.
*/
#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;
-}
D keyboards/keebsforall/freebirdnp/pro/pro.c => keyboards/keebsforall/freebirdnp/pro/pro.c +0 -28
@@ 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;
-}
M keyboards/keychron/v10/v10.c => keyboards/keychron/v10/v10.c +0 -14
@@ 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
M keyboards/keychron/v6/v6.c => keyboards/keychron/v6/v6.c +0 -14
@@ 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
M keyboards/keyprez/rhino/rhino.c => keyboards/keyprez/rhino/rhino.c +0 -6
@@ 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,
M keyboards/keyprez/unicorn/unicorn.c => keyboards/keyprez/unicorn/unicorn.c +0 -14
@@ 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
M keyboards/keystonecaps/gameroyadvance/gameroyadvance.c => keyboards/keystonecaps/gameroyadvance/gameroyadvance.c +0 -28
@@ 16,31 16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
M keyboards/kiwikeebs/macro/macro.c => keyboards/kiwikeebs/macro/macro.c +0 -12
@@ 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;
-}
M keyboards/kiwikeebs/macro_v2/macro_v2.c => keyboards/kiwikeebs/macro_v2/macro_v2.c +0 -12
@@ 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;
-}
M keyboards/kiwikey/borderland/borderland.c => keyboards/kiwikey/borderland/borderland.c +0 -14
@@ 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
M keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c => keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c +0 -14
@@ 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
M keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c => keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c +0 -14
@@ 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
M keyboards/latincompass/latinpadble/latinpadble.c => keyboards/latincompass/latinpadble/latinpadble.c +0 -10
@@ 14,13 14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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;
-}
M keyboards/ll3macorn/bongopad/bongopad.c => keyboards/ll3macorn/bongopad/bongopad.c +0 -16
@@ 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()) {
D keyboards/lpad/lpad.c => keyboards/lpad/lpad.c +0 -18
@@ 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
M keyboards/lw67/lw67.c => keyboards/lw67/lw67.c +0 -13
@@ 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;
-}
-
M keyboards/lw75/lw75.c => keyboards/lw75/lw75.c +0 -15
@@ 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
-
M keyboards/lyso1/lck75/lck75.c => keyboards/lyso1/lck75/lck75.c +0 -12
@@ 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
M keyboards/macro1/macro1.c => keyboards/macro1/macro1.c +0 -15
@@ 14,18 14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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;
-}
M keyboards/mechwild/bde/rev2/rev2.c => keyboards/mechwild/bde/rev2/rev2.c +0 -16
@@ 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',
M keyboards/mechwild/mercutio/mercutio.c => keyboards/mechwild/mercutio/mercutio.c +0 -19
@@ 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,
M keyboards/mechwild/obe/obe.c => keyboards/mechwild/obe/obe.c +0 -16
@@ 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
M keyboards/mechwild/waka60/waka60.c => keyboards/mechwild/waka60/waka60.c +0 -16
@@ 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
M keyboards/meletrix/zoom65/zoom65.c => keyboards/meletrix/zoom65/zoom65.c +0 -6
@@ 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
M keyboards/meletrix/zoom65_lite/zoom65_lite.c => keyboards/meletrix/zoom65_lite/zoom65_lite.c +0 -8
@@ 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
M keyboards/metamechs/timberwolf/timberwolf.c => keyboards/metamechs/timberwolf/timberwolf.c +0 -10
@@ 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;
-}
M keyboards/mini_elixivy/mini_elixivy.c => keyboards/mini_elixivy/mini_elixivy.c +0 -11
@@ 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;
-}
D keyboards/mk65/mk65.c => keyboards/mk65/mk65.c +0 -31
@@ 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>
\ No newline at end of file
M keyboards/mwstudio/alicekk/alicekk.c => keyboards/mwstudio/alicekk/alicekk.c +0 -14
@@ 14,17 14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
D keyboards/mwstudio/mw80/mw80.c => keyboards/mwstudio/mw80/mw80.c +0 -31
@@ 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
M keyboards/nullbitsco/snap/snap.c => keyboards/nullbitsco/snap/snap.c +0 -14
@@ 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
M keyboards/onekeyco/dango40/dango40.c => keyboards/onekeyco/dango40/dango40.c +0 -10
@@ 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/>.
*/
#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;
-}
M keyboards/orthocode/orthocode.c => keyboards/orthocode/orthocode.c +0 -13
@@ 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
D keyboards/pauperboards/brick/brick.c => keyboards/pauperboards/brick/brick.c +0 -31
@@ 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
M keyboards/pearlboards/atlas/atlas.c => keyboards/pearlboards/atlas/atlas.c +0 -14
@@ 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
M keyboards/pearlboards/pandora/pandora.c => keyboards/pearlboards/pandora/pandora.c +0 -18
@@ 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) {
M keyboards/pearlboards/zeus/zeus.c => keyboards/pearlboards/zeus/zeus.c +0 -17
@@ 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
M keyboards/pearlboards/zeuspad/zeuspad.c => keyboards/pearlboards/zeuspad/zeuspad.c +0 -18
@@ 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) {
M keyboards/pica40/rev1/rev1.c => keyboards/pica40/rev1/rev1.c +0 -12
@@ 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
D keyboards/program_yoink/program_yoink.c => keyboards/program_yoink/program_yoink.c +0 -29
@@ 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;
-}
M keyboards/rart/rart75hs/rart75hs.c => keyboards/rart/rart75hs/rart75hs.c +0 -16
@@ 13,19 13,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
M keyboards/rart/rart75m/rart75m.c => keyboards/rart/rart75m/rart75m.c +0 -16
@@ 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()) {
M keyboards/rart/rartland/rartland.c => keyboards/rart/rartland/rartland.c +0 -16
@@ 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()) {
D keyboards/reedskeebs/alish40/alish40.c => keyboards/reedskeebs/alish40/alish40.c +0 -22
@@ 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
M keyboards/ristretto/ristretto.c => keyboards/ristretto/ristretto.c +0 -12
@@ 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;
D keyboards/rmkeebs/rm_numpad/rm_numpad.c => keyboards/rmkeebs/rm_numpad/rm_numpad.c +0 -31
@@ 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
M keyboards/rotr/rotr.c => keyboards/rotr/rotr.c +0 -10
@@ 1,11 1,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;
-}
M keyboards/rubi/rubi.c => keyboards/rubi/rubi.c +0 -5
@@ 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;
-}
M keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.c => keyboards/sawnsprojects/krush/krush65/hotswap/hotswap.c +0 -14
@@ 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
M keyboards/sneakbox/aliceclonergb/aliceclonergb.c => keyboards/sneakbox/aliceclonergb/aliceclonergb.c +0 -14
@@ 16,17 16,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
M keyboards/spacey/spacey.c => keyboards/spacey/spacey.c +0 -12
@@ 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;
-}
M keyboards/sthlmkb/litl/litl.c => keyboards/sthlmkb/litl/litl.c +0 -14
@@ 14,17 14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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
M keyboards/taleguers/taleguers75/taleguers75.c => keyboards/taleguers/taleguers75/taleguers75.c +0 -11
@@ 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;
-}
M keyboards/tau4/tau4.c => keyboards/tau4/tau4.c +0 -14
@@ 17,20 17,6 @@ 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) { /* 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; }
D keyboards/thepanduuh/degenpad/degenpad.c => keyboards/thepanduuh/degenpad/degenpad.c +0 -31
@@ 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
M keyboards/tkc/portico75/portico75.c => keyboards/tkc/portico75/portico75.c +0 -16
@@ 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
D keyboards/tominabox1/bigboy/bigboy.c => keyboards/tominabox1/bigboy/bigboy.c +0 -31
@@ 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 */
D keyboards/ungodly/nines/nines.c => keyboards/ungodly/nines/nines.c +0 -34
@@ 1,34 0,0 @@
-/* Copyright 2020 Ungodly Design <hello@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 <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) { /* 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;
-}
M keyboards/viendi8l/viendi8l.c => keyboards/viendi8l/viendi8l.c +0 -11
@@ 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
M keyboards/work_louder/work_board/work_board.c => keyboards/work_louder/work_board/work_board.c +0 -14
@@ 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
M keyboards/wuque/mammoth75x/mammoth75x.c => keyboards/wuque/mammoth75x/mammoth75x.c +0 -6
@@ 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
M keyboards/wuque/serneity65/serneity65.c => keyboards/wuque/serneity65/serneity65.c +0 -11
@@ 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
D keyboards/z12/z12.c => keyboards/z12/z12.c +0 -23
@@ 1,23 0,0 @@
-/* Copyright 2020 Sergi Meseguer <zigotica@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) {
- return encoder_update_user(index, clockwise);
-}
-#endif
M quantum/encoder.c => quantum/encoder.c +23 -1
@@ 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) {