Adds delete/backspace key. Resolves #93
This commit is contained in:
parent
1ad7602a9b
commit
fc8ddba6cb
@ -193,6 +193,7 @@
|
||||
|`KC.RESET` |Put the keyboard into DFU mode for flashing |
|
||||
|`KC.DEBUG` |Toggle `debug_enabled`, which enables log spew to serial console |
|
||||
|`KC.GESC` |Escape when tapped, <code>`</code> when pressed with Shift or GUI|
|
||||
|`KC.BKDL` |Backspace when tapped, Delete when pressed with GUI |
|
||||
|`KC.LEAD` |The [Leader key] |
|
||||
|`KC.UC_MODE_NOOP` |Sets UnicodeMode to NOOP |
|
||||
|`KC.UC_MODE_LINUX` |Sets UnicodeMode to Linux |
|
||||
|
@ -74,6 +74,29 @@ def gesc_released(key, state, KC, *args, **kwargs):
|
||||
return state
|
||||
|
||||
|
||||
def bkdl_pressed(key, state, KC, *args, **kwargs):
|
||||
BKDL_TRIGGERS = {KC.LGUI, KC.RGUI}
|
||||
|
||||
if BKDL_TRIGGERS.intersection(state.keys_pressed):
|
||||
state.config._send_hid()
|
||||
state.keys_pressed.add(KC.DEL)
|
||||
state.hid_pending = True
|
||||
return state
|
||||
|
||||
# else return KC_ESC
|
||||
state.keys_pressed.add(KC.BKSP)
|
||||
state.hid_pending = True
|
||||
|
||||
return state
|
||||
|
||||
|
||||
def bkdl_released(key, state, KC, *args, **kwargs):
|
||||
state.keys_pressed.discard(KC.BKSP)
|
||||
state.keys_pressed.discard(KC.DEL)
|
||||
state.hid_pending = True
|
||||
return state
|
||||
|
||||
|
||||
def sleep_pressed(key, state, KC, *args, **kwargs):
|
||||
sleep_ms(key.meta.ms)
|
||||
return state
|
||||
|
@ -618,6 +618,7 @@ make_key(names=('BOOTLOADER',), on_press=handlers.bootloader)
|
||||
make_key(names=('DEBUG', 'DBG'), on_press=handlers.debug_pressed, on_release=handlers.passthrough)
|
||||
|
||||
make_key(names=('GESC',), on_press=handlers.gesc_pressed, on_release=handlers.gesc_released)
|
||||
make_key(names=('BKDL',), on_press=handlers.bkdl_pressed, on_release=handlers.bkdl_released)
|
||||
make_key(
|
||||
names=('LEADER', 'LEAD'),
|
||||
on_press=handlers.leader_pressed,
|
||||
|
Loading…
Reference in New Issue
Block a user