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

Q3 Pro DIP switch custom behavior #282

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
6 changes: 6 additions & 0 deletions keyboards/keychron/bluetooth/factory_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#if defined(ENABLE_FACTORY_TEST)

#include "quantum.h"
#include "raw_hid.h"
#ifdef KC_BLUETOOTH_ENABLE
Expand Down Expand Up @@ -330,6 +332,7 @@ void factory_test_rx(uint8_t *data, uint8_t length) {
}
}

#if !defined(KEYCHRON_DIP_SWITCH_USER)
bool dip_switch_update_user(uint8_t index, bool active) {
if (report_os_sw_state) {
#ifdef INVERT_OS_SWITCH_STATE
Expand All @@ -341,3 +344,6 @@ bool dip_switch_update_user(uint8_t index, bool active) {

return true;
}
#endif

#endif //ENABLE_FACTORY_TEST
6 changes: 3 additions & 3 deletions keyboards/keychron/q3_pro/q3_pro.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ static void pairing_key_timer_cb(void *arg) {

#ifdef DIP_SWITCH_ENABLE
bool dip_switch_update_kb(uint8_t index, bool active) {
#if !defined(KEYCHRON_DIP_SWITCH_USER)
if (index == 0) {
default_layer_set(1UL << (active ? 2 : 0));
}
dip_switch_update_user(index, active);

return true;
#endif
return dip_switch_update_user(index, active);
}
#endif

Expand Down
Loading