Skip to content

gesture.send() no longer disables numlock#17900

Merged
seanbudd merged 4 commits into
nvaccess:betafrom
CyrilleB79:numlockGesture
Apr 7, 2025
Merged

gesture.send() no longer disables numlock#17900
seanbudd merged 4 commits into
nvaccess:betafrom
CyrilleB79:numlockGesture

Conversation

@CyrilleB79

@CyrilleB79 CyrilleB79 commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #10827

Blocking #17901

Summary of the issue:

In NVDA's code, when numpadPlus, numpadMinus, numpadMultiply and numpadDivide is pressed, we make a difference if numlock is enabled or disabled, by artificially making numlock a modifier. Though, when numlock modifier is used in a gesture's key name and gesture.send is used, numlock key event is really sent to the system, causing numlock deactivation.

Description of user facing changes

None

Description of development approach

In KeyboardInputGesture.send method, filter numlock as a modifier so that it is never sent to the system.

Testing strategy:

Known issues with pull request:

Technically, it would change the behaviour of the send method. Is it considered an API-breaking change? I'd say not since it just fixes an undesirable and unexpected behaviour.
Merging this change would cause a bug in Windows Magnifier add-on (3.7), in which a workaround of #10827 was already implemented. Though, being my own add-on, I'll take care of it.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai summary

@CyrilleB79 CyrilleB79 changed the base branch from master to beta April 4, 2025 13:50
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

@seanbudd I am targetting beta if you consider this an API-breaking change or if you also accept #17901 in beta.

If you consider this PR to be an API-breaking change, I'll have to move the change log item in API breaking changes section.

If you do not accept this PR in beta branch, I'll have to move the change log in 2025.2 section.

@CyrilleB79 CyrilleB79 marked this pull request as ready for review April 4, 2025 15:30
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner April 4, 2025 15:30
@CyrilleB79 CyrilleB79 requested a review from seanbudd April 4, 2025 15:30
Comment thread user_docs/en/changes.md Outdated
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

This PR is actually fixing an internal bug. But t bug is not visible by users, it's only visible by add-on developers:

  1. The bug is not visible at all if NVDA is run without add-on
  2. The bug is visible if a developer develops an add-on using gesture.send() in a script mapped with numlock+numpadPlus/Minus/Multiply/Divide, as I did in Windows Magnifier add-on.

So In which section should I put this change log item?

@seanbudd seanbudd merged commit 6363dd9 into nvaccess:beta Apr 7, 2025
@github-actions github-actions Bot added this to the 2025.2 milestone Apr 7, 2025
seanbudd pushed a commit that referenced this pull request Apr 7, 2025
Follow-up of #17545

Blocked by #17900

Summary of the issue:
#17545 has implemented the announcement resulting of the action to collapse or expand headings in Word with shift+alt+plus/- when using plus/minus on the main keyboard and on the numpad. Thought, using the numpad plus/minus key on the numpad does not report anything if numlock is enabled.

Description of user facing changes
alt+shift+numpadPlus/Minus will now report headings expanding / collapsing, no matter if numlock is on or off.

Description of development approach
Added the two gestures with numlock on in the gestures list of the script.
@CyrilleB79 CyrilleB79 deleted the numlockGesture branch April 7, 2025 08:35
@CyrilleB79 CyrilleB79 modified the milestones: 2025.2, 2025.1 Apr 7, 2025
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

Successfully merging this pull request may close these issues.

Using gesture.send deactivates unwantedly NumLock

2 participants