globalbibletools / gbt

https://interlinear.globalbibletools.com
15 stars 2 forks source link

Shortcut keys for navigation #188

Closed BethedenMinistries closed 7 months ago

BethedenMinistries commented 1 year ago

BART has a good system of shortcut keys I'd like to keep. People are already used to them, so if we're going to get people to switch over, they'll need to have the shortcuts they're used to.

arrocke commented 1 year ago

Yep, we can totally port over those over as we get more functionality. I think of the functionality that's already built we're just missing the navigation shortcuts. I'll try to remember to add the other shortcuts as we build those features.

Pertempto commented 1 year ago

@arrocke Are there any libraries/tools in React that you'd recommend using to implement the shortcuts?

arrocke commented 1 year ago

I think we just need to attach a keydown event to the window while the translation view is loaded, and then use the key field on the event to decide what to do.

Pertempto commented 1 year ago

Our input fields are causing issues. They seem to swallow up all the ArrowUp, ArrowDown, home, and end keydown events. I'll try to figure out if there's a workaround.

Pertempto commented 1 year ago

https://headlessui.com/react/combobox#keyboard-interaction

Pertempto commented 1 year ago

It would be great if the combobox supported a way to add more keyboard shortcuts, or even just enable/disable their default keyboard shortcuts, but I don't see any options for that.

Pertempto commented 1 year ago

I found a workaround, https://github.com/tailwindlabs/headlessui/discussions/820#discussioncomment-5878478, by adding an onKeyDown property to the inner input.

arrocke commented 1 year ago

@BethedenMinistries Control + Arrow keys conflicts with OS shortcuts for macs. Addison has the navigation shortcuts working with Control, but we need to do some research into how to build shortcuts that are compatible in multiple OSes.

arrocke commented 1 year ago

Going to keep this open until we have a solution for mac controls, and to make sure the other features we are in the process of adding get keyboard controls

arrocke commented 7 months ago

Going to close this now that we have other issues open for the remaining shortcuts