From 4ab673ba80360adaeb5ddba1f4150285e11fb925 Mon Sep 17 00:00:00 2001 From: Josh Klar Date: Wed, 23 Jan 2019 01:51:31 -0800 Subject: [PATCH] Resolves #106: Unbreak KC.GESC --- kmk/handlers/stock.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kmk/handlers/stock.py b/kmk/handlers/stock.py index 3ad69c4..b404794 100644 --- a/kmk/handlers/stock.py +++ b/kmk/handlers/stock.py @@ -51,8 +51,13 @@ def gesc_pressed(key, state, KC, *args, **kwargs): GESC_TRIGGERS = {KC.LSHIFT, KC.RSHIFT, KC.LGUI, KC.RGUI} if GESC_TRIGGERS.intersection(state.keys_pressed): + # First, release GUI if already pressed + state.keys_pressed.discard(KC.LGUI) + state.keys_pressed.discard(KC.RGUI) + state.config._send_hid() # if Shift is held, KC_GRAVE will become KC_TILDE on OS level state.keys_pressed.add(KC.GRAVE) + state.hid_pending = True return state # else return KC_ESC