From 37aeeac10aa63e75ef5e182da414f073a83018a6 Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Thu, 11 Oct 2018 19:14:23 -0700 Subject: [PATCH 1/2] Should have been caps as these are const --- kmk/consts.py | 8 ++++---- kmk/internal_state.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kmk/consts.py b/kmk/consts.py index 080379a..bcc5dea 100644 --- a/kmk/consts.py +++ b/kmk/consts.py @@ -150,7 +150,7 @@ class UnicodeModes: class LeaderMode: - Default = 0 - Default_Active = 1 - Enter = 2 - Enter_Active = 3 + DEFAULT = 0 + DEFAULT_ACTIVE = 1 + ENTER = 2 + ENTER_ACTIVE = 3 diff --git a/kmk/internal_state.py b/kmk/internal_state.py index 5f7f90f..ebcd852 100644 --- a/kmk/internal_state.py +++ b/kmk/internal_state.py @@ -90,7 +90,7 @@ class InternalState: import kmk_keyboard_user self.unicode_mode = getattr(kmk_keyboard_user, 'unicode_mode', UnicodeModes.NOOP) self.tap_time = getattr(kmk_keyboard_user, 'tap_time', 300) - self.leader_mode = getattr(kmk_keyboard_user, 'leader_mode', LeaderMode.Enter) + self.leader_mode = getattr(kmk_keyboard_user, 'leader_mode', LeaderMode.ENTER) self.LEADER_DICTIONARY = getattr(kmk_keyboard_user, 'LEADER_DICTIONARY', {}) self.preserve_intermediate_states = preserve_intermediate_states From 5313e5f5b51eb7f75eb28b2331a753c5f6cf946a Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Thu, 11 Oct 2018 19:35:41 -0700 Subject: [PATCH 2/2] Fixed caps issue on leader_dictionary and debug_enable --- kmk/entrypoints/handwire/circuitpython_samd51.py | 4 ++-- kmk/entrypoints/handwire/pyboard.py | 4 ++-- kmk/internal_state.py | 2 +- kmk/leader_mode.py | 4 ++-- user_keymaps/kdb424/handwire_planck_featherm4.py | 4 ++-- user_keymaps/kdb424/handwire_planck_pyboard.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/kmk/entrypoints/handwire/circuitpython_samd51.py b/kmk/entrypoints/handwire/circuitpython_samd51.py index 67f6b1a..28bfca6 100644 --- a/kmk/entrypoints/handwire/circuitpython_samd51.py +++ b/kmk/entrypoints/handwire/circuitpython_samd51.py @@ -12,9 +12,9 @@ def main(): keymap = getattr(kmk_keyboard_user, 'keymap') rows = getattr(kmk_keyboard_user, 'rows') - DEBUG_ENABLE = getattr(kmk_keyboard_user, 'DEBUG_ENABLE', False) + debug_enable = getattr(kmk_keyboard_user, 'debug_enable', False) - if DEBUG_ENABLE: + if debug_enable: from logging import DEBUG as log_level else: from logging import ERROR as log_level diff --git a/kmk/entrypoints/handwire/pyboard.py b/kmk/entrypoints/handwire/pyboard.py index 7ea1375..0a0562a 100644 --- a/kmk/entrypoints/handwire/pyboard.py +++ b/kmk/entrypoints/handwire/pyboard.py @@ -14,9 +14,9 @@ def main(): keymap = getattr(kmk_keyboard_user, 'keymap') rows = getattr(kmk_keyboard_user, 'rows') - DEBUG_ENABLE = getattr(kmk_keyboard_user, 'DEBUG_ENABLE', False) + debug_enable = getattr(kmk_keyboard_user, 'debug_enable', False) - if DEBUG_ENABLE: + if debug_enable: from logging import DEBUG as log_level else: from logging import ERROR as log_level diff --git a/kmk/internal_state.py b/kmk/internal_state.py index ebcd852..f3efc43 100644 --- a/kmk/internal_state.py +++ b/kmk/internal_state.py @@ -91,7 +91,7 @@ class InternalState: self.unicode_mode = getattr(kmk_keyboard_user, 'unicode_mode', UnicodeModes.NOOP) self.tap_time = getattr(kmk_keyboard_user, 'tap_time', 300) self.leader_mode = getattr(kmk_keyboard_user, 'leader_mode', LeaderMode.ENTER) - self.LEADER_DICTIONARY = getattr(kmk_keyboard_user, 'LEADER_DICTIONARY', {}) + self.leader_dictionary = getattr(kmk_keyboard_user, 'leader_dictionary', {}) self.preserve_intermediate_states = preserve_intermediate_states def __enter__(self): diff --git a/kmk/leader_mode.py b/kmk/leader_mode.py index d638ab0..b555f44 100644 --- a/kmk/leader_mode.py +++ b/kmk/leader_mode.py @@ -78,8 +78,8 @@ def process(state): """ lmh = tuple(state.leader_mode_history) - if lmh in state.LEADER_DICTIONARY: - state.macro_pending = state.LEADER_DICTIONARY[lmh].keydown + if lmh in state.leader_dictionary: + state.macro_pending = state.leader_dictionary[lmh].keydown state.keys_pressed.clear() diff --git a/user_keymaps/kdb424/handwire_planck_featherm4.py b/user_keymaps/kdb424/handwire_planck_featherm4.py index aec444f..0011027 100644 --- a/user_keymaps/kdb424/handwire_planck_featherm4.py +++ b/user_keymaps/kdb424/handwire_planck_featherm4.py @@ -16,7 +16,7 @@ diode_orientation = DiodeOrientation.COLUMNS unicode_mode = UnicodeModes.LINUX tap_time = 200 leader_timeout = 2000 -DEBUG_ENABLE = True +debug_enable = True emoticons = AttrDict({ # Emoticons, but fancier @@ -35,7 +35,7 @@ for k, v in emoticons.items(): # ---------------------- Leader Key Macros -------------------------------------------- -LEADER_DICTIONARY = { +leader_dictionary = { (KC.F, KC.L, KC.I, KC.P): emoticons.ANGRY_TABLE_FLIP, (KC.C, KC.H, KC.E, KC.E, KC.R): emoticons.CHEER, (KC.W, KC.A, KC.T): emoticons.WAT, diff --git a/user_keymaps/kdb424/handwire_planck_pyboard.py b/user_keymaps/kdb424/handwire_planck_pyboard.py index 589a16a..f268306 100644 --- a/user_keymaps/kdb424/handwire_planck_pyboard.py +++ b/user_keymaps/kdb424/handwire_planck_pyboard.py @@ -18,7 +18,7 @@ diode_orientation = DiodeOrientation.COLUMNS unicode_mode = UnicodeModes.LINUX tap_time = 150 leader_timeout = 2000 -DEBUG_ENABLE = False +debug_enable = False # -------------------------------Macros ----------------------------------------------- @@ -41,7 +41,7 @@ for k, v in emoticons.items(): # ---------------------- Leader Key Macros -------------------------------------------- gc.collect() -LEADER_DICTIONARY = { +leader_dictionary = { (KC.F, KC.L, KC.I, KC.P): emoticons.ANGRY_TABLE_FLIP, (KC.C, KC.H, KC.E, KC.E, KC.R): emoticons.CHEER, (KC.W, KC.A, KC.T): emoticons.WAT,