Skip to content

[ReaderHighlight] NT: add key event to simulate a very long press#13914

Merged
Frenzie merged 2 commits into
koreader:masterfrom
Commodore64user:lon-long-press
Jun 21, 2025
Merged

[ReaderHighlight] NT: add key event to simulate a very long press#13914
Frenzie merged 2 commits into
koreader:masterfrom
Commodore64user:lon-long-press

Conversation

@Commodore64user

@Commodore64user Commodore64user commented Jun 5, 2025

Copy link
Copy Markdown
Member

what's new

On touch devices, it is possible to do a very long press (usually three seconds) on a selection, which brings up the _highlight_buttons dialogue. On non-touch devices, this is obviously not possible in the same way, so we now use press for the main action (normal highlight as seen in the screen recording), and shift/screenkb + press to call said dialogue.

  • Updated registerKeyEvents() to unify handling for devices with physical keyboards and screen keyboards by introducing a modifier variable. This simplifies the logic for assigning key events for text selection.
  • Added onHighlightModifierPress() method to simulate a long-press action using the modifier key, enabling long-press dialogs during text selection.

screen recording

name

This change is Reviewable

@Frenzie Frenzie added this to the 2025.05 milestone Jun 9, 2025
@Commodore64user

Commodore64user commented Jun 16, 2025

Copy link
Copy Markdown
Member Author

last minute addition to allow multiple highlights and performing dict lookups on already highlighted words.

@Commodore64user

Copy link
Copy Markdown
Member Author

Any comments?

@Frenzie Frenzie merged commit 6bc5b16 into koreader:master Jun 21, 2025
4 checks passed
@Commodore64user Commodore64user deleted the lon-long-press branch June 21, 2025 11:07
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
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.

2 participants