Add BLE_DISCONNECT key
This commit is contained in:
parent
dc9b5f4512
commit
449aab7dcb
@ -127,3 +127,13 @@ def ble_refresh(key, keyboard, *args, **kwargs):
|
|||||||
keyboard._hid_helper.stop_advertising()
|
keyboard._hid_helper.stop_advertising()
|
||||||
keyboard._hid_helper.start_advertising()
|
keyboard._hid_helper.start_advertising()
|
||||||
return keyboard
|
return keyboard
|
||||||
|
|
||||||
|
|
||||||
|
def ble_disconnect(key, keyboard, *args, **kwargs):
|
||||||
|
from kmk.hid import HIDModes
|
||||||
|
|
||||||
|
if keyboard.hid_type != HIDModes.BLE:
|
||||||
|
return keyboard
|
||||||
|
|
||||||
|
keyboard._hid_helper.clear_bonds()
|
||||||
|
return keyboard
|
||||||
|
@ -364,6 +364,7 @@ def maybe_make_unicode_key(candidate: str) -> Optional[Key]:
|
|||||||
def maybe_make_firmware_key(candidate: str) -> Optional[Key]:
|
def maybe_make_firmware_key(candidate: str) -> Optional[Key]:
|
||||||
keys = (
|
keys = (
|
||||||
((('BLE_REFRESH',), handlers.ble_refresh)),
|
((('BLE_REFRESH',), handlers.ble_refresh)),
|
||||||
|
((('BLE_DISCONNECT',), handlers.ble_disconnect)),
|
||||||
((('BOOTLOADER',), handlers.bootloader)),
|
((('BOOTLOADER',), handlers.bootloader)),
|
||||||
((('DEBUG', 'DBG'), handlers.debug_pressed)),
|
((('DEBUG', 'DBG'), handlers.debug_pressed)),
|
||||||
((('HID_SWITCH', 'HID'), handlers.hid_switch)),
|
((('HID_SWITCH', 'HID'), handlers.hid_switch)),
|
||||||
|
Loading…
Reference in New Issue
Block a user