Various fixes for keyboards not implementing callbacks correctly (#24116)

This commit is contained in:
Joel Challis
2024-07-14 06:38:04 +01:00
committed by GitHub
parent e76069ea4e
commit c0aca9f45c
8 changed files with 30 additions and 33 deletions

View File

@@ -130,11 +130,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return process_record_user(keycode, record);
}
__attribute__((weak)) bool encoder_update_keymap(uint8_t index, bool clockwise) { return true; }
__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { return encoder_update_keymap(index, clockwise); }
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) {
if (encoder_update_user(index, clockwise)) {
// Encoder 1, outside left
if (index == 0 && clockwise) {
tap_code(KC_MS_U); // turned right

View File

@@ -24,8 +24,5 @@ enum TWOx1800_keycodes {
ENC_BTN4,
};
// Encoder update function that returns true/false
bool encoder_update_keymap(uint8_t index, bool clockwise);
// Encoder button combo check
void check_encoder_buttons(void);

View File

@@ -96,16 +96,11 @@ void matrix_init_kb(void) {
matrix_init_user();
}
__attribute__ ((weak))
bool encoder_update_keymap(int8_t index, bool clockwise) {
return false;
}
#define NUM_COLUMNS 8*MAX7219_CONTROLLERS
uint8_t led_position[2] = {0,0}; // The location of the cursor in the matrix
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_keymap(index, clockwise)) {
if (encoder_update_user(index, clockwise)) {
#if defined(DRAWING_TOY_MODE)
// Encoder 1, left
if (index == 0 && clockwise) {