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

Desktop: Accessibility: Prevent overwrite mode toggle shortcut from conflicting with screen reader shortcuts #11447

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

On Linux, the Orca screen reader's default modifier key is insert. Before this pull request, pressing insert as part of a screen reader shortcut (e.g. insert-h), entered overwrite mode.

This pull request:

  • Prevents insert from entering overwrite mode if another key was pressed before releasing insert.
  • To allow this check to work, enters/exits insert mode on keyup rather than on keydown.
    • A custom keyUpHandler CodeMirror extension was created to allow this.

Testing plan

This pull request adds a new overwriteModeExtension automated test that verifies that the following process does not enable insert mode:

  1. Pressing insert.
  2. Pressing and releasing some other key.
  3. Releasing insert.

Additionally, on Fedora 41:

  1. Enable the Orca screen reader.
  2. Open Joplin and open a note in the Markdown editor.
  3. Press insert.
    • With Orca enabled (at least with my desktop environment), the onkeyup event handler is not invoked when the user releases insert (though the onkeydown handler is on key down). With Orca disabled, both onkeydown and onkeyup are received.
  4. Verify that insert mode has not been enabled.
  5. Press insert twice quickly.
  6. Verify that overwrite mode is enabled.
  7. Press escape.
  8. Verify that overwrite mode is disabled.
  9. Disable Orca and restart Joplin.
  10. Open a note.
  11. Press insert.
  12. Verify that overwrite mode is enabled.

Comment on lines +75 to +76
// TODO: Localize:
enabled ? 'Overwrite mode enabled' : 'Overwrite mode disabled',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #11441

@personalizedrefrigerator personalizedrefrigerator added desktop All desktop platforms accessibility Related to accessibility labels Nov 26, 2024
@laurent22 laurent22 merged commit 4e8b896 into laurent22:dev Nov 27, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to accessibility desktop All desktop platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants