Skip to content

Commit

Permalink
Honour multi keypress timeout for NVDA key (#17219)
Browse files Browse the repository at this point in the history
Fix-up of #12049 

Summary of the issue:
When implementing multi keypress timeout in #12049, the timeout for double press of NVDA key (to execute native function) was not honoured.

Description of user facing changes
Multiple key press timeout will now be honoured also for double press of NVDA key.

Description of development approach
Replace the hard-coded value 0.5 with the config value.
  • Loading branch information
CyrilleB79 committed Oct 1, 2024
1 parent 9fe4541 commit 8259ce2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/keyboardHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down Expand Up @@ -203,7 +203,10 @@ 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"] / 1000
)
)
):
# The user wants the key to serve its normal function instead of acting as an NVDA modifier key.
Expand Down

0 comments on commit 8259ce2

Please sign in to comment.