Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not report 'unselected' when new selection occurs #11775

Open
CyrilleB79 opened this issue Oct 20, 2020 · 4 comments
Open

Do not report 'unselected' when new selection occurs #11775

CyrilleB79 opened this issue Oct 20, 2020 · 4 comments

Comments

@CyrilleB79
Copy link
Collaborator

CyrilleB79 commented Oct 20, 2020

Steps to reproduce:

  • open notepad
  • Type the following 3 lines:
    Test:
    Hello world
    Hello NVDA
    
  • Press ctrl+Home to go back to the start of the file
  • press ctrl+F to open notepad's find dialog
  • type 'hello' (without quotes) in the search field
  • press Enter to find the next occurrence
    At this point, the first 'Hello' is selected but the 'Find' dialog is still open
  • press Escape to close the Find dialog
    At this point the selection is reported by NVDA
  • press F3 to find the next occurrence

Note: My system is in French so maybe the description of notepad's dialogs is not accurate.

Actual behavior:

NVDA announces:
"Hello selected Hello unselected"
Actually these are 2 messages:

  • "Hello selected" (message related to the selection of the second occurrence of "Hello")
  • "Hello unselected" (message related to the selection removal on the first occurrence of "Hello")

Expected behavior:

Having these 2 messages leads to confusion:

  • The user may think that at the end, the text has been unselected.
  • The selection / unselection actions are not reported in the order in which they are actually executed.
    Moreover, having these 2 messages is too much verbose and do not carry any additional information for the user. Indeed if a new selection is reported, the user should know that the old selection was rremoved.

Thus I suggest that old selection removal be not reported when new selection is reported.
Technically however, I do not know if it is something easy to do.

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

2020.3

Windows version:

10

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

N/A

Other information about your system:

N/A

Other questions

Does the issue still occur after restarting your computer?

Yes

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

2019.2.1 with same result

If addons are disabled, is your problem still occuring?

Yes

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

No

@feerrenrut
Copy link
Contributor

It may be useful to note that #11326 sounds similar in title but is not a duplicate. However, there may be some overlap for someone looking to fix either of these issues.

@mltony
Copy link
Contributor

mltony commented Nov 11, 2020

I fixed this issue in my Tony's enhancements add-on. You'd need to check "Suppress saying of 'unselected'." in the options. The code happens to be somewhat hacky - I ended up listening to all keypresses, and only if the last keypress doesn't contain Shift modifier, only then we suppress "unselected" - because if the user unselects a character with Shift+left/right, then we don't want to suppress the 'unselected' message. If NVDA devs are interested, I can convert this into NVDA PR for review.

@CyrilleB79
Copy link
Collaborator Author

@mltony are you still interested in implementing this in core?
If yes, it would be nice to hear from NV Access if they accept your "hacky" design before proceeding.

@mltony
Copy link
Contributor

mltony commented Mar 5, 2024

Sure, I can work on that. This is how I propose to implement this - and essentially this is how it is implemented in Tony's enhancements add-on:

  1. In inputCore.InputManager.executeGesture we analyze if current gesture is a keyboard gesture, and if so, we store in a global variable globalVars.performingShiftGesture: bool whether the last gesture contains shift as modifier.
  2. IN speech\speech.speakSelectionChange we check value of globalVars.performingShiftGesture and if True, then we set speakUnselected = False.
    Rationale: when some text is selected, it only makes sense to say "Unselected" if user meant to unselect a char, a word, a line, etc. All these gestures contain shift modifier. On the other hand, if a user pressed for example control+Home, that means that the user intends to go to the beginning of the document. While it's true that whatever selection was present is being unselected at this point, in practice people find this annoying, especially since "Unselected" message goes after the primary message (in control+home example that would be the first line of the document) - and thus often confusing, since it makes you believe that there is some extra words present in the first line. So I propose to suppress saying "Unselected" unless the last gesture contains shift modifier.
    @seanbudd, does this implementation make sense to you? I know it's a little hacky, but I don't see any better way to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants