shabados / presenter

Desktop app for presenting the Shabad OS Database on projectors, TVs, and live streams
https://shabados.com
MIT License
19 stars 15 forks source link

Crtl-Up/Down Hotkey doesn't change shabad on First/Last line #504

Closed sarabveer closed 4 years ago

sarabveer commented 4 years ago

Crtl-Up and Crtl-Down changes the line to the first/last line respectively, but doesn't change the shabad when used again

bhajneet commented 4 years ago

Looks like this is taking precedence:

image

image

Which maybe doesn't allow these to fire?

image

Any guidance @Harjot1Singh ?

bhajneet commented 4 years ago

If I delete 183 and 184 from withNavigationHotkeys it starts to work correctly, so I believe the issue is with the hotkeys precedence being over-ridden by NavigationHotkeys.js

No idea on how to solve though

Harjot1Singh commented 4 years ago

Good investigative work.

A cheeky but acceptable way to solve this would be to disable those hotkeys inside withNavigationHotkeys when in the navigator. The downside of this would be that you'd lose debounce for home/ctrl-up + end/ctrl-down keys. Which I think is OK in this instance since you can still use up/down and the other hotkeys straight after with debounce (but I think if you hit end up up, you'll end up with a transition to the last line and second last line, and then debounce will kick in, instead of a transition to only the last line)

To go about this, note L189 in withNavigationHotkeys. Can't remember how it's passed in, but just pass in { first: null, last: null } for the keymap in Navigator.js. I think it might be suppliable where withNavigationHotkeys( Navigator ) is called, but do check.