diff --git a/kmk/common/internal_keycodes.py b/kmk/common/internal_keycodes.py index 4263227..ca8e55c 100644 --- a/kmk/common/internal_keycodes.py +++ b/kmk/common/internal_keycodes.py @@ -16,13 +16,44 @@ def process_internal_key_event(state, action, changed_key, logger=None): return tg(state, action, changed_key, logger=logger) elif changed_key.code == Keycodes.Layers._KC_TO: return to(state, action, changed_key, logger=logger) + elif changed_key == Keycodes.KMK.KC_GESC: + return grave_escape(action, state, logger=logger) else: return state -def tilde(state, action, changed_key, logger): - # TODO Actually process keycodes - return state +def grave_escape(action, state, logger): + if action['type'] == KEY_DOWN_EVENT: + for key in state.keys_pressed: + if key in {Keycodes.Modifiers.KC_LSHIFT, Keycodes.Modifiers.KC_RSHIFT}: + # if Shift is held, return KC_GRAVE which will become KC_TILDE on OS level + return state.update( + keys_pressed=( + state.keys_pressed | {Keycodes.Common.KC_GRAVE} + ), + ) + elif key in {Keycodes.Modifiers.KC_LGUI, Keycodes.Modifiers.KC_RGUI}: + # if GUI is held, return KC_GRAVE + return state.update( + keys_pressed=( + state.keys_pressed | {Keycodes.Common.KC_GRAVE} + ), + ) + + # else return KC_ESC + return state.update( + keys_pressed=( + state.keys_pressed | {Keycodes.Common.KC_ESCAPE} + ), + ) + + elif action['type'] == KEY_UP_EVENT: + return state.update( + keys_pressed=frozenset( + key for key in state.keys_pressed + if key not in {Keycodes.Common.KC_ESCAPE, Keycodes.Common.KC_GRAVE} + ), + ) def df(state, action, changed_key, logger): diff --git a/linux-udev/99-stm-bootloader.rules b/linux-udev/99-stm-bootloader.rules new file mode 100644 index 0000000..b87133f --- /dev/null +++ b/linux-udev/99-stm-bootloader.rules @@ -0,0 +1 @@ +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", GROUP="uucp", MODE="0660" diff --git a/user_keymaps/kdb424/handwire_planck_pyboard.py b/user_keymaps/kdb424/handwire_planck_pyboard.py index 8274a6b..1c011e0 100644 --- a/user_keymaps/kdb424/handwire_planck_pyboard.py +++ b/user_keymaps/kdb424/handwire_planck_pyboard.py @@ -14,7 +14,7 @@ diode_orientation = DiodeOrientation.COLUMNS keymap = [ [ # Default - [KC.ESC, KC.QUOTE, KC.COMMA, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BKSP], + [KC.GESC, KC.QUOTE, KC.COMMA, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BKSP], [KC.TAB, KC.A, KC.O, KC.E, KC.U, KC.I, KC.D, KC.H, KC.T, KC.N, KC.S, KC.ENT], [KC.LSFT, KC.SCLN, KC.Q, KC.J, KC.K, KC.X, KC.B, KC.M, KC.W, KC.V, KC.Z, KC.SLSH], [KC.LCTRL, KC.LGUI, KC.LALT, KC.MO(2), KC.MO(3), KC.SPC, KC.SPC, KC.MO(4), KC.LEFT, KC.DOWN, KC.UP, KC.RIGHT], diff --git a/user_keymaps/klardotsh/threethree_matrix_pyboard.py b/user_keymaps/klardotsh/threethree_matrix_pyboard.py index 7960e56..9fe47a3 100644 --- a/user_keymaps/klardotsh/threethree_matrix_pyboard.py +++ b/user_keymaps/klardotsh/threethree_matrix_pyboard.py @@ -12,7 +12,7 @@ diode_orientation = DiodeOrientation.COLUMNS keymap = [ [ - [KC.MO(1), KC.H, KC.RESET], + [KC.MO(1), KC.GESC, KC.RESET], [KC.MO(2), KC.HASH, KC.ENTER], [KC.LCTRL, KC.SPACE, KC.LSHIFT], ],