Everything necessary to get this to boot finally. Planck types!

This commit is contained in:
Josh Klar
2018-12-29 06:03:31 -08:00
parent 39a6465658
commit 57239e3163
9 changed files with 138 additions and 68 deletions

View File

@@ -1,4 +1,5 @@
from kmk.keycodes import ALL_KEYS, KC, make_key
from kmk.keycodes import KC, make_key
from kmk.handlers.stock import passthrough
from kmk.types import KeySequenceMeta
@@ -23,6 +24,7 @@ def simple_key_sequence(seq):
return make_key(
meta=KeySequenceMeta(seq),
on_press=sequence_press_handler,
on_release=passthrough,
)
@@ -30,7 +32,7 @@ def send_string(message):
seq = []
for char in message:
kc = ALL_KEYS[char]
kc = KC[char]
if char.isupper():
kc = KC.LSHIFT(kc)

View File

@@ -7,19 +7,22 @@ def passthrough(key, state, *args, **kwargs):
def default_pressed(key, state, KC, coord_int=None, coord_raw=None):
state.hid_pending = True
if coord_int is not None:
state.coord_keys_pressed[coord_int] = key
state.add_key(key)
state.keys_pressed.add(key)
return state
def default_released(key, state, KC, coord_int=None, coord_raw=None):
state.remove_key(key)
state.hid_pending = True
state.keys_pressed.discard(key)
if coord_int is not None:
state.keys_pressed.discard(key.coord_keys_pressed.get(coord_int, None))
state.keys_pressed.discard(state.coord_keys_pressed.get(coord_int, None))
state.coord_keys_pressed[coord_int] = None
return state
@@ -81,9 +84,9 @@ def leader_pressed(key, state, *args, **kwargs):
return state._begin_leader_mode()
def tap_dance_pressed(key, state, *args, **kwargs):
def td_pressed(key, state, *args, **kwargs):
return state._process_tap_dance(key, True)
def tap_dance_released(key, state, *args, **kwargs):
def td_released(key, state, *args, **kwargs):
return state._process_tap_dance(key, False)