nvda icon indicating copy to clipboard operation
nvda copied to clipboard

Input Gestures Dialog: Don't allow Duplicate Gestures to be Defined

Open elliott94 opened this issue 5 years ago • 5 comments

Steps to reproduce:

For this example, we'll use the "Read Current Status Bar" action

  1. Open the Input Gestures dialog, and find the "Read Current Status Bar" action

  2. Hit the "Add" button, and when prompted to specify the gesture to use, hit NVDA + S; specify that it should be active for both Desktop and Laptop keyboard layouts

  3. Once again, hit the "Add" button, and when prompted to perform the gesture, specify the exact same gesture as before (NVDA + S) and choose to bind the gesture to both the Desktop and Laptop keyboard layouts - when done, you'll notice two duplicate gestures in the list for the action

  4. Hit the "OK" button to save the changes - when now looking at gestures.ini, you'll notice that the new gesture has been added twice

  5. Re-open the Input Gestures dialog, and find the "Read Current Status Bar" action - you'll notice that three gestures are defined: the two default gestures that ship with NVDA, and the custom gesture that we defined previously

  6. Highlight our custom gesture, and hit the "Remove" button to remove it from the list - next, hit the "OK" button

  7. Go back into the Input Gestures dialog, and once again find "Read Current Status Bar" - despite just removing our custom gesture, you'll notice that it is still listed. Hit "Remove" once again, and then finally hit "OK" to remove it once and for all

The above behaviour can be observed because it appears that NVDA doesn't check to see if the gesture already exists when a gesture is added; as a result, when we chose to remove our custom gesture the first time, we only removed a single instance of it from gestures.ini; when opening the Input Gestures dialog again the gesture was still listed due to the final instance still being present within the gestures.ini file.

Expected behavior:

When adding a gesture, NVDA should first check to ensure that the same gesture hasn't already been bound to the exact same action as the one that the user is attempting to define

System configuration

NVDA installed/portable/running from source:

NVDA version:

2019.3.1

Windows version:

Name and version of other software in use when reproducing the issue:

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Have you tried any other versions of NVDA? If so, please report their behaviors.

If addons are disabled, is your problem still occuring?

Did you try to run the COM registry fixing tool in NVDA menu / tools?

elliott94 avatar Mar 12 '20 19:03 elliott94

Please restart NVDA after step 4. I guess an error message still prompts on NVDA startup. Then open "gestures.ini" with Notepad++. This file should now contain two identical entries. I played with this – I guess – in 2018. So I'm unsure about the current situation regarding duplicate allocations.

DrSooom avatar Mar 13 '20 09:03 DrSooom

This is related to #7074

ehollig avatar Mar 15 '20 01:03 ehollig

Closing as duplicate of #3848.

Adriani90 avatar Mar 27 '24 21:03 Adriani90

@Adriani90 I object to this being closed. It may be better listed as a duplicate of #3605, but even so, it highlights an even stranger issue than either of those. If you look at the original STR, it demonstrates assigning one gesture twice to the same action. That is not covered by either of the other issues, and should not be permitted at all.

It also requires a slightly different fix than either #3605 or #3848.

XLTechie avatar Mar 28 '24 00:03 XLTechie

Reopening as per https://github.com/nvaccess/nvda/issues/10872#issuecomment-2024175437.

CyrilleB79 avatar Mar 28 '24 08:03 CyrilleB79