From feb61464fe1a6bc49133700a606951d462f4b9f2 Mon Sep 17 00:00:00 2001 From: Alexander Pushkov Date: Mon, 7 Apr 2025 07:39:16 +0700 Subject: [PATCH] =?UTF-8?q?Fix:=20don=E2=80=99t=20append=20actions=20twice?= =?UTF-8?q?=20for=20a=20given=20key/key=5Fname=20combination?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kalamine/generators/keylayout.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kalamine/generators/keylayout.py b/kalamine/generators/keylayout.py index f084c65..359d1f8 100644 --- a/kalamine/generators/keylayout.py +++ b/kalamine/generators/keylayout.py @@ -120,11 +120,16 @@ def append_actions(key: str, symbol: str, actions: List[Tuple[str, str]]) -> Non ret_actions.append(f"") continue + already = [] for i in [Layer.BASE, Layer.SHIFT, Layer.ALTGR, Layer.ALTGR_SHIFT]: if key_name == "spce" or key_name not in layout.layers[i]: continue key = layout.layers[i][key_name] + if key in already: + continue + already.append(key) + if i and key == layout.layers[Layer.BASE][key_name]: continue if key in layout.dead_keys: