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 back default Encoder Callbacks for Keychron Q/V series #20307

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 28 additions & 0 deletions keyboards/keychron/keychron.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* Copyright 2023 @ Keychron (https://www.keychron.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 true;
}
#endif // ENCODER_ENABLE
1 change: 1 addition & 0 deletions keyboards/keychron/q0/rev_0130/rev_0130.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = {
{0, C_2, A_2, B_2}, // 20
};
#endif // RGB_MATRIX_ENABLE

1 change: 1 addition & 0 deletions keyboards/keychron/q1/ansi_encoder/ansi_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ led_config_t g_led_config = {
};

#endif // RGB_MATRIX_ENABLE

2 changes: 1 addition & 1 deletion keyboards/keychron/q1/q1.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
return true;
}

#endif // DIP_SWITCH_ENABLE
#endif // DIP_SWITCH_ENABLE
1 change: 1 addition & 0 deletions keyboards/keychron/q10/ansi_encoder/ansi_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,4 @@ led_config_t g_led_config = {
};

#endif // RGB_MATRIX_ENABLE

1 change: 1 addition & 0 deletions keyboards/keychron/q10/iso_encoder/iso_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ led_config_t g_led_config = {
};

#endif // RGB_MATRIX_ENABLE

1 change: 1 addition & 0 deletions keyboards/keychron/q65/ansi_encoder/ansi_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ led_config_t g_led_config = {
};

#endif // RGB_MATRIX_ENABLE

1 change: 1 addition & 0 deletions keyboards/keychron/q9/ansi_encoder/ansi_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ led_config_t g_led_config = {
};

#endif // RGB_MATRIX_ENABLE

1 change: 1 addition & 0 deletions keyboards/keychron/v10/ansi_encoder/ansi_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,4 @@ led_config_t g_led_config = {
};

#endif // RGB_MATRIX_ENABLE

1 change: 1 addition & 0 deletions keyboards/keychron/v10/iso_encoder/iso_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ led_config_t g_led_config = {
};

#endif // RGB_MATRIX_ENABLE