From 299ecc67a61109feae235ebaf5a00151cc758c82 Mon Sep 17 00:00:00 2001 From: Jun Mizutani Date: Tue, 15 Aug 2023 19:39:01 +0200 Subject: [PATCH 1/3] Fix : #104838 Ctrl, Alt, Shift keys are not listed in "Is key Free" addon Ctrl, Alt, Shift keys are not listed in "List All Shortcuts". "myitem.ctrl is True" is always False, when myitem.ctrl == 1. It should be "myitem.ctrl == 1" and so on. --- development_iskeyfree.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/development_iskeyfree.py b/development_iskeyfree.py index 7eb8b6414..8034f0c68 100644 --- a/development_iskeyfree.py +++ b/development_iskeyfree.py @@ -47,13 +47,13 @@ class MyChecker(): def check(cls, findkey, ctrl, alt, shift, oskey): if len(findkey) > 0: cmd = "" - if ctrl is True: + if ctrl == 1: cmd += "Ctrl+" - if alt is True: + if alt == 1: cmd += "Alt+" - if shift is True: + if shift == 1: cmd += "Shift+" - if oskey is True: + if oskey == 1: cmd += "OsKey+" cls.lastfind = cmd + findkey.upper() cls.lastkey = findkey.upper() @@ -66,21 +66,21 @@ class MyChecker(): for context, keyboardmap in wm.keyconfigs.user.keymaps.items(): for myitem in keyboardmap.keymap_items: - if myitem.active is True and myitem.type == findkey: - if ctrl is True and myitem.ctrl is not True: + if myitem.active == 1 and myitem.type == findkey: + if ctrl == 1 and myitem.ctrl == 0: continue - if alt is True and myitem.alt is not True: + if alt == 1 and myitem.alt == 0: continue - if shift is True and myitem.shift is not True: + if shift == 1 and myitem.shift == 0: continue - if oskey is True and myitem.oskey is not True: + if oskey == 1 and myitem.oskey == 0: continue t = (context, myitem.type, - "Ctrl" if myitem.ctrl is True else "", - "Alt" if myitem.alt is True else "", - "Shift" if myitem.shift is True else "", - "OsKey" if myitem.oskey is True else "", + "Ctrl" if myitem.ctrl == 1 else "", + "Alt" if myitem.alt == 1 else "", + "Shift" if myitem.shift == 1 else "", + "OsKey" if myitem.oskey == 1 else "", myitem.name) mykeys.append(t) @@ -512,10 +512,10 @@ class IsKeyFreeRunExportKeys(Operator): col_width = padding + 2 if padding > col_width else col_width short_type = myitem.type if myitem.type else "UNKNOWN" - is_ctrl = " Ctrl" if myitem.ctrl is True else "" - is_alt = " Alt" if myitem.alt is True else "" - is_shift = " Shift" if myitem.shift is True else "" - is_oskey = " OsKey" if myitem.oskey is True else "" + is_ctrl = " Ctrl" if myitem.ctrl == 1 else "" + is_alt = " Alt" if myitem.alt == 1 else "" + is_shift = " Shift" if myitem.shift == 1 else "" + is_oskey = " OsKey" if myitem.oskey == 1 else "" short_cuts = "{}{}{}{}{}".format(short_type, is_ctrl, is_alt, is_shift, is_oskey) t = ( -- 2.30.2 From 8a65396544c315d3c50e97150f1774fc622e3e0a Mon Sep 17 00:00:00 2001 From: Jun Mizutani Date: Wed, 16 Aug 2023 07:00:00 +0200 Subject: [PATCH 2/3] Fix : #104838 Ctrl, Alt, Shift keys are not listed in "Is key Free" addon Ctrl, Alt, Shift keys are not listed in "List All Shortcuts". "myitem.ctrl is True" is always False, when myitem.ctrl == 1. It should be "myitem.ctrl == 1" and so on. --- development_iskeyfree.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/development_iskeyfree.py b/development_iskeyfree.py index 7eb8b6414..a01b8bbe0 100644 --- a/development_iskeyfree.py +++ b/development_iskeyfree.py @@ -47,13 +47,13 @@ class MyChecker(): def check(cls, findkey, ctrl, alt, shift, oskey): if len(findkey) > 0: cmd = "" - if ctrl is True: + if ctrl : cmd += "Ctrl+" - if alt is True: + if alt : cmd += "Alt+" - if shift is True: + if shift : cmd += "Shift+" - if oskey is True: + if oskey : cmd += "OsKey+" cls.lastfind = cmd + findkey.upper() cls.lastkey = findkey.upper() @@ -66,21 +66,21 @@ class MyChecker(): for context, keyboardmap in wm.keyconfigs.user.keymaps.items(): for myitem in keyboardmap.keymap_items: - if myitem.active is True and myitem.type == findkey: - if ctrl is True and myitem.ctrl is not True: + if myitem.active and myitem.type == findkey: + if ctrl and not myitem.ctrl: continue - if alt is True and myitem.alt is not True: + if alt and not myitem.alt: continue - if shift is True and myitem.shift is not True: + if shift and myitem.shift: continue - if oskey is True and myitem.oskey is not True: + if oskey and myitem.oskey: continue t = (context, myitem.type, - "Ctrl" if myitem.ctrl is True else "", - "Alt" if myitem.alt is True else "", - "Shift" if myitem.shift is True else "", - "OsKey" if myitem.oskey is True else "", + "Ctrl" if myitem.ctrl else "", + "Alt" if myitem.alt else "", + "Shift" if myitem.shift else "", + "OsKey" if myitem.oskey else "", myitem.name) mykeys.append(t) @@ -512,10 +512,10 @@ class IsKeyFreeRunExportKeys(Operator): col_width = padding + 2 if padding > col_width else col_width short_type = myitem.type if myitem.type else "UNKNOWN" - is_ctrl = " Ctrl" if myitem.ctrl is True else "" - is_alt = " Alt" if myitem.alt is True else "" - is_shift = " Shift" if myitem.shift is True else "" - is_oskey = " OsKey" if myitem.oskey is True else "" + is_ctrl = " Ctrl" if myitem.ctrl else "" + is_alt = " Alt" if myitem.alt else "" + is_shift = " Shift" if myitem.shift else "" + is_oskey = " OsKey" if myitem.oskey else "" short_cuts = "{}{}{}{}{}".format(short_type, is_ctrl, is_alt, is_shift, is_oskey) t = ( -- 2.30.2 From ad30f3d57720b691d41949c50933294161d46217 Mon Sep 17 00:00:00 2001 From: Jun Mizutani Date: Wed, 16 Aug 2023 15:08:00 +0900 Subject: [PATCH 3/3] Fix : #104838 Ctrl, Alt, Shift keys are not listed in "Is key Free" addon --- development_iskeyfree.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/development_iskeyfree.py b/development_iskeyfree.py index 7eb8b6414..82defb8ff 100644 --- a/development_iskeyfree.py +++ b/development_iskeyfree.py @@ -47,13 +47,13 @@ class MyChecker(): def check(cls, findkey, ctrl, alt, shift, oskey): if len(findkey) > 0: cmd = "" - if ctrl is True: + if ctrl : cmd += "Ctrl+" - if alt is True: + if alt : cmd += "Alt+" - if shift is True: + if shift : cmd += "Shift+" - if oskey is True: + if oskey : cmd += "OsKey+" cls.lastfind = cmd + findkey.upper() cls.lastkey = findkey.upper() @@ -66,21 +66,21 @@ class MyChecker(): for context, keyboardmap in wm.keyconfigs.user.keymaps.items(): for myitem in keyboardmap.keymap_items: - if myitem.active is True and myitem.type == findkey: - if ctrl is True and myitem.ctrl is not True: + if myitem.active and myitem.type == findkey: + if ctrl and not myitem.ctrl: continue - if alt is True and myitem.alt is not True: + if alt and not myitem.alt: continue - if shift is True and myitem.shift is not True: + if shift and not myitem.shift: continue - if oskey is True and myitem.oskey is not True: + if oskey and not myitem.oskey: continue t = (context, myitem.type, - "Ctrl" if myitem.ctrl is True else "", - "Alt" if myitem.alt is True else "", - "Shift" if myitem.shift is True else "", - "OsKey" if myitem.oskey is True else "", + "Ctrl" if myitem.ctrl else "", + "Alt" if myitem.alt else "", + "Shift" if myitem.shift else "", + "OsKey" if myitem.oskey else "", myitem.name) mykeys.append(t) @@ -512,10 +512,10 @@ class IsKeyFreeRunExportKeys(Operator): col_width = padding + 2 if padding > col_width else col_width short_type = myitem.type if myitem.type else "UNKNOWN" - is_ctrl = " Ctrl" if myitem.ctrl is True else "" - is_alt = " Alt" if myitem.alt is True else "" - is_shift = " Shift" if myitem.shift is True else "" - is_oskey = " OsKey" if myitem.oskey is True else "" + is_ctrl = " Ctrl" if myitem.ctrl else "" + is_alt = " Alt" if myitem.alt else "" + is_shift = " Shift" if myitem.shift else "" + is_oskey = " OsKey" if myitem.oskey else "" short_cuts = "{}{}{}{}{}".format(short_type, is_ctrl, is_alt, is_shift, is_oskey) t = ( -- 2.30.2