Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core/fallback encoder behaviour #20320

Merged
merged 7 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unnecessary encoder_update_kb functions
  • Loading branch information
waffle87 committed Apr 2, 2023
commit 9df48e583ccad18bf5494a8d781808bb7b480a4d
11 changes: 0 additions & 11 deletions keyboards/acheron/shark/beta/beta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 0 additions & 14 deletions keyboards/adafruit/macropad/macropad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 0 additions & 15 deletions keyboards/aidansmithdotdev/fine40/fine40.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 0 additions & 12 deletions keyboards/anavi/knob1/knob1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
16 changes: 0 additions & 16 deletions keyboards/anavi/macropad10/macropad10.c

This file was deleted.

24 changes: 0 additions & 24 deletions keyboards/ano/ano.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 0 additions & 17 deletions keyboards/atlantis/ps17/ps17.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
14 changes: 0 additions & 14 deletions keyboards/bolsa/damapad/damapad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 0 additions & 10 deletions keyboards/cannonkeys/balance/balance.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,3 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http:https://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;
}
14 changes: 0 additions & 14 deletions keyboards/cannonkeys/ortho60v2/ortho60v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,3 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http:https://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
29 changes: 0 additions & 29 deletions keyboards/checkerboards/phoenix45_ortho/phoenix45_ortho.c

This file was deleted.

29 changes: 0 additions & 29 deletions keyboards/checkerboards/quark/quark.c

This file was deleted.

12 changes: 0 additions & 12 deletions keyboards/checkerboards/quark_squared/quark_squared.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
16 changes: 0 additions & 16 deletions keyboards/chocofly/chocofly.c

This file was deleted.

12 changes: 0 additions & 12 deletions keyboards/ck60i/ck60i.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,3 @@ along with this program. If not, see <http:https://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;
}
29 changes: 0 additions & 29 deletions keyboards/coban/pad3a/pad3a.c

This file was deleted.

27 changes: 0 additions & 27 deletions keyboards/crbn/crbn.c

This file was deleted.

38 changes: 0 additions & 38 deletions keyboards/custommk/genesis/rev1/rev1.c

This file was deleted.

Loading