From 695c4c603005469704cd678a1d3ffb093d7e1231 Mon Sep 17 00:00:00 2001 From: adophoxia <100170946+adophoxia@users.noreply.github.com> Date: Tue, 24 Jan 2023 00:51:45 -0800 Subject: [PATCH] [Keyboard] Add missing `dip_switch_update_kb` for Keychron V2 (#19674) --- keyboards/keychron/v2/v2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/keyboards/keychron/v2/v2.c b/keyboards/keychron/v2/v2.c index 852a9637c4..7703c280df 100644 --- a/keyboards/keychron/v2/v2.c +++ b/keyboards/keychron/v2/v2.c @@ -26,6 +26,17 @@ const matrix_row_t matrix_mask[] = { #ifdef DIP_SWITCH_ENABLE +bool dip_switch_update_kb(uint8_t index, bool active) { + if (!dip_switch_update_user(index, active)) { return false;} + if (index == 0) { + default_layer_set(1UL << (active ? 1 : 0)); + } + return true; +} + +#endif // DIP_SWITCH_ENABLE + +#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX) bool process_record_kb(uint16_t keycode, keyrecord_t *record) { if (!process_record_user(keycode, record)) { return false; } switch (keycode) {