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

Hot swapping dictionaries unavailable on NT devices #11783

Closed
Commodore64user opened this issue May 8, 2024 · 3 comments · Fixed by #11803
Closed

Hot swapping dictionaries unavailable on NT devices #11783

Commodore64user opened this issue May 8, 2024 · 3 comments · Fixed by #11803
Labels
NT Non Touch devices
Milestone

Comments

@Commodore64user
Copy link
Contributor

  • KOReader version: Sourdough
  • Device: kindle 4 (Applies to all non-touch devices)

Issue

Hamburger menu in the dictionary lookup/wiki pop up box inaccessible to non-touch users.
When using the dictionary, this option allows the user to quickly hot swap dictionaries.

Steps to reproduce

Select a word to bring up dictionary, press up/down to cycle through the menu. Suffer in silence as the menu loops back without ever reaching the burger. Cry.

@Commodore64user Commodore64user changed the title Hot swap dictionary unavailable on NT devices Hot swapping dictionaries unavailable on NT devices May 8, 2024
@Commodore64user
Copy link
Contributor Author

forgot to say, the edit button next to 1/2 also is inaccessible.

@hius07
Copy link
Member

hius07 commented May 10, 2024

As a Master of NT devices you may want to investigate the work of FocusManager in, for example, the Menu widget (our lists).

self.layout is populated with menu items:

-- this is for focus manager
table.insert(self.layout, {item_tmp})

then the TitleBar left and right buttons are added:
-- merge TitleBar layout into self FocusManager layout
function Menu:mergeTitleBarIntoLayout()

and finally self.layout goes to FocusManager who handles key pressings:
if Device:hasDPad() then
local event_keys = {}
-- these will all generate the same event, just with different arguments
table.insert(event_keys, { "FocusUp", { { "Up" }, event = "FocusMove", args = {0, -1} } })
table.insert(event_keys, { "FocusRight", { { "Right" }, event = "FocusMove", args = {1, 0} } })
table.insert(event_keys, { "FocusDown", { { "Down" }, event = "FocusMove", args = {0, 1} } })
table.insert(event_keys, { "Press", { { "Press" }, event = "Press" } })
local FEW_KEYS_END_INDEX = #event_keys -- Few keys device: only setup up, down, right and press

and so on.

I'm afraid the touchscreen users are not much encouraged to dig into it.

@hius07 hius07 added the NT Non Touch devices label May 10, 2024
@Commodore64user
Copy link
Contributor Author

Commodore64user commented May 10, 2024

As a Master of NT

I am not the master, @comphilip is the true 'master of puppets' here. with his magnificent PRs #8712 and later #8859 and his masterpiece here #8877. I am at best a monkey with a typewriter. Maybe one day I will write Shakespeare level stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NT Non Touch devices
Projects
None yet
3 participants