Fix Kyle board, and unbreak MO-dependent layers
This commit is contained in:
parent
0d94bf4c06
commit
d042b458f0
@ -176,18 +176,18 @@ class InternalState:
|
|||||||
# Sets the timer start and acts like MO otherwise
|
# Sets the timer start and acts like MO otherwise
|
||||||
self.start_time['lm'] = ticks_ms()
|
self.start_time['lm'] = ticks_ms()
|
||||||
self.keys_pressed.add(changed_key.kc)
|
self.keys_pressed.add(changed_key.kc)
|
||||||
return self.mo(changed_key, is_pressed)
|
return self._layer_mo(changed_key, is_pressed)
|
||||||
|
|
||||||
self.keys_pressed.discard(changed_key.kc)
|
self.keys_pressed.discard(changed_key.kc)
|
||||||
self.start_time['lm'] = None
|
self.start_time['lm'] = None
|
||||||
return self.mo(changed_key, is_pressed)
|
return self._layer_mo(changed_key, is_pressed)
|
||||||
|
|
||||||
def _layer_lt(self, changed_key, is_pressed):
|
def _layer_lt(self, changed_key, is_pressed):
|
||||||
"""Momentarily activates layer if held, sends kc if tapped"""
|
"""Momentarily activates layer if held, sends kc if tapped"""
|
||||||
if is_pressed:
|
if is_pressed:
|
||||||
# Sets the timer start and acts like MO otherwise
|
# Sets the timer start and acts like MO otherwise
|
||||||
self.start_time['lt'] = ticks_ms()
|
self.start_time['lt'] = ticks_ms()
|
||||||
return self.mo(changed_key, is_pressed)
|
return self._layer_mo(changed_key, is_pressed)
|
||||||
|
|
||||||
# On keyup, check timer, and press key if needed.
|
# On keyup, check timer, and press key if needed.
|
||||||
if self.start_time['lt'] and (
|
if self.start_time['lt'] and (
|
||||||
@ -197,7 +197,7 @@ class InternalState:
|
|||||||
self.pending_keys.add(changed_key.kc)
|
self.pending_keys.add(changed_key.kc)
|
||||||
|
|
||||||
self.start_time['lt'] = None
|
self.start_time['lt'] = None
|
||||||
return self.mo(changed_key, is_pressed)
|
return self._layer_mo(changed_key, is_pressed)
|
||||||
|
|
||||||
def _layer_tg(self, changed_key, is_pressed):
|
def _layer_tg(self, changed_key, is_pressed):
|
||||||
"""Toggles the layer (enables it if not active, and vise versa)"""
|
"""Toggles the layer (enables it if not active, and vise versa)"""
|
||||||
@ -229,7 +229,7 @@ class InternalState:
|
|||||||
if self.start_time['tt'] is None:
|
if self.start_time['tt'] is None:
|
||||||
# Sets the timer start and acts like MO otherwise
|
# Sets the timer start and acts like MO otherwise
|
||||||
self.start_time['tt'] = ticks_ms()
|
self.start_time['tt'] = ticks_ms()
|
||||||
return self.mo(changed_key, is_pressed)
|
return self._layer_mo(changed_key, is_pressed)
|
||||||
elif ticks_diff(ticks_ms(), self.start_time['tt']) < self.tap_time:
|
elif ticks_diff(ticks_ms(), self.start_time['tt']) < self.tap_time:
|
||||||
self.start_time['tt'] = None
|
self.start_time['tt'] = None
|
||||||
return self.tg(changed_key, is_pressed)
|
return self.tg(changed_key, is_pressed)
|
||||||
@ -240,7 +240,7 @@ class InternalState:
|
|||||||
# On first press, works like MO. On second press, does nothing unless let up within
|
# On first press, works like MO. On second press, does nothing unless let up within
|
||||||
# time window, then acts like TG.
|
# time window, then acts like TG.
|
||||||
self.start_time['tt'] = None
|
self.start_time['tt'] = None
|
||||||
return self.mo(changed_key, is_pressed)
|
return self._layer_mo(changed_key, is_pressed)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
from kmk.consts import DiodeOrientation, UnicodeModes
|
from kmk.consts import DiodeOrientation, UnicodeModes
|
||||||
from kmk.entrypoints.handwire.circuitpython_samd51 import main
|
|
||||||
from kmk.keycodes import KC
|
from kmk.keycodes import KC
|
||||||
from kmk.keycodes import generate_leader_dictionary_seq as glds
|
from kmk.keycodes import generate_leader_dictionary_seq as glds
|
||||||
from kmk.macros.simple import send_string
|
from kmk.macros.simple import send_string
|
||||||
@ -17,7 +16,7 @@ keyboard.diode_orientation = DiodeOrientation.COLUMNS
|
|||||||
|
|
||||||
# ------------------User level config variables ---------------------------------------
|
# ------------------User level config variables ---------------------------------------
|
||||||
keyboard.unicode_mode = UnicodeModes.LINUX
|
keyboard.unicode_mode = UnicodeModes.LINUX
|
||||||
keyboard.tap_time = 200
|
keyboard.tap_time = 900
|
||||||
keyboard.leader_timeout = 2000
|
keyboard.leader_timeout = 2000
|
||||||
keyboard.debug_enabled = True
|
keyboard.debug_enabled = True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user