-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
[wip] Add new keyboard shortcuts #355
base: master
Are you sure you want to change the base?
Conversation
I did some generalization of the icon code and replaced the ctrl-X style icons with a seperate ctrl + X icon, which I think looks a little nicer. |
My primary concern with this is figuring out the right keystrokes to use. I'm hesitant to start using
This is obviously a little bit more complicated than the existing work, but I don't think it dramatically complicates things since we definitely want to move this stuff into the reducer anyway. |
To answer your other questions:
|
As an alternative, what if the keypress handling takes place in the component, and that dispatches the correct action? I think that might be a good separation of concerns. So e.g. Puzzle sees UpArrow is pressed and dispatches a GridAction that moves up. |
I think this is a reasonable suggestion - as long as we can find a way to still do code sharing for all the overlap between the various grid views (puzzle, builder, etc). I'm sure we can. The only hiccup with this approach is that the keyboard handler will need some state now to track where we are in a chord, assuming we go with the chording approach (which I'm definitely leaning towards). So we'll just need to think about the right way to structure that so it's easy to share across the different components. Maybe a react hook so we can have state and it returns a callback we register as the event handler. I'm sure there's a cleaner way, that's the first thought that came to me. |
Fixes #218:
!
,@
,#
will check square, entry, grid, use withCtrl
to reveal.@
toggles autofill in constructor.Labeled WIP because I'm not entirely happy with this.
Key = { k: KeyK, mods: Modifier[] }
or something.