From 88d479cb345c67f889b855bbbebdc8b211c2c1f8 Mon Sep 17 00:00:00 2001 From: Cyrille Bougot Date: Wed, 25 Sep 2024 23:37:01 +0200 Subject: [PATCH 1/4] Honour multi keypress delay for NVDA key --- source/keyboardHandler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/keyboardHandler.py b/source/keyboardHandler.py index 5154af0c548..f94c18cb980 100644 --- a/source/keyboardHandler.py +++ b/source/keyboardHandler.py @@ -2,7 +2,7 @@ # A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. -# Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V., Cyrille Bougot +# Copyright (C) 2006-2024 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V., Cyrille Bougot """Keyboard support""" @@ -203,7 +203,7 @@ def internal_keyDownEvent(vkCode, scanCode, extended, injected): or ( keyCode == lastNVDAModifier and lastNVDAModifierReleaseTime - and time.time() - lastNVDAModifierReleaseTime < 0.5 + and time.time() - lastNVDAModifierReleaseTime < config.conf["keyboard"]["multiPressTimeout"] ) ): # The user wants the key to serve its normal function instead of acting as an NVDA modifier key. From f4da469d6810ab9351aa5723f0ccadc83b7e3fcb Mon Sep 17 00:00:00 2001 From: Cyrille Bougot Date: Thu, 26 Sep 2024 08:07:15 +0200 Subject: [PATCH 2/4] Fix conversion factor --- source/keyboardHandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/keyboardHandler.py b/source/keyboardHandler.py index f94c18cb980..3741114f4e6 100644 --- a/source/keyboardHandler.py +++ b/source/keyboardHandler.py @@ -203,7 +203,7 @@ def internal_keyDownEvent(vkCode, scanCode, extended, injected): or ( keyCode == lastNVDAModifier and lastNVDAModifierReleaseTime - and time.time() - lastNVDAModifierReleaseTime < config.conf["keyboard"]["multiPressTimeout"] + and time.time() - lastNVDAModifierReleaseTime < config.conf["keyboard"]["multiPressTimeout"] / 1000 ) ): # The user wants the key to serve its normal function instead of acting as an NVDA modifier key. From 685fa5a27a9089defdad2ef64da2bde4db538d43 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 06:20:26 +0000 Subject: [PATCH 3/4] Pre-commit auto-fix --- source/keyboardHandler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/keyboardHandler.py b/source/keyboardHandler.py index 3741114f4e6..5494f800ba7 100644 --- a/source/keyboardHandler.py +++ b/source/keyboardHandler.py @@ -203,7 +203,8 @@ def internal_keyDownEvent(vkCode, scanCode, extended, injected): or ( keyCode == lastNVDAModifier and lastNVDAModifierReleaseTime - and time.time() - lastNVDAModifierReleaseTime < config.conf["keyboard"]["multiPressTimeout"] / 1000 + and time.time() - lastNVDAModifierReleaseTime + < config.conf["keyboard"]["multiPressTimeout"] / 1000 ) ): # The user wants the key to serve its normal function instead of acting as an NVDA modifier key. From aed380fa73930e5a569440850db83f1a4cd20205 Mon Sep 17 00:00:00 2001 From: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:34:52 +1000 Subject: [PATCH 4/4] Added brackets for clarity --- source/keyboardHandler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/keyboardHandler.py b/source/keyboardHandler.py index 5494f800ba7..df2fb3c47ef 100644 --- a/source/keyboardHandler.py +++ b/source/keyboardHandler.py @@ -203,8 +203,10 @@ def internal_keyDownEvent(vkCode, scanCode, extended, injected): or ( keyCode == lastNVDAModifier and lastNVDAModifierReleaseTime - and time.time() - lastNVDAModifierReleaseTime - < config.conf["keyboard"]["multiPressTimeout"] / 1000 + and ( + time.time() - lastNVDAModifierReleaseTime + < config.conf["keyboard"]["multiPressTimeout"] / 1000 + ) ) ): # The user wants the key to serve its normal function instead of acting as an NVDA modifier key.