summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2022-08-25 16:01:51 +0800
committerlokher <lokher@gmail.com>2022-08-25 16:01:51 +0800
commit6829fbd074c11e731b92be11e7fa857b8ab9baba (patch)
treeeba4144d7cd83b52b5cfea3631acdd3dde3c44ce /keyboards
parent485e45ea67cff8b823e7dbadba47da75fc3bfc31 (diff)
Limit BT_HSTx keycode works in bluetooth mode only
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/keychron/k8_pro/k8_pro.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/keyboards/keychron/k8_pro/k8_pro.c b/keyboards/keychron/k8_pro/k8_pro.c
index e9ed9dad93..58b1e70779 100644
--- a/keyboards/keychron/k8_pro/k8_pro.c
+++ b/keyboards/keychron/k8_pro/k8_pro.c
@@ -110,13 +110,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false; // Skip all further processing of this key
#ifdef BLUETOOTH_ENABLE
case BT_HST1 ... BT_HST3:
- if (record->event.pressed) {
- host_idx = keycode - BT_HST1 + 1;
- chVTSet(&pairing_key_timer, TIME_MS2I(2000), (vtfunc_t)pairing_key_timer_cb, &host_idx);
- bluetooth_connect_ex(host_idx, 0);
- } else {
- host_idx = 0;
- chVTReset(&pairing_key_timer);
+ if (get_transport() == TRANSPORT_BLUETOOTH) {
+ if (record->event.pressed) {
+ host_idx = keycode - BT_HST1 + 1;
+ chVTSet(&pairing_key_timer, TIME_MS2I(2000), (vtfunc_t)pairing_key_timer_cb, &host_idx);
+ bluetooth_connect_ex(host_idx, 0);
+ } else {
+ host_idx = 0;
+ chVTReset(&pairing_key_timer);
+ }
}
break;
case BAT_LVL: