I would like to avoid using hooks for that. Is it possible to handle key combination for live views ? Especially for Cmd + LETTER, and Cmd + Shift + LETTER.
Asked
Active
Viewed 687 times
3
-
does this help, https://hexdocs.pm/phoenix_live_view/bindings.html#key-events? – Daniel Feb 02 '21 at 16:05
-
3That document helped me, but the biggest thing I had to figure out was that I needed to take in `keydown` events for `Shift` (for example), store an assign (like `shift_key` set to `true`) and then turn that off during the `keyup` event for `Shift`. Then I could use the `shift_key` assign when other keys were pressed – Brian Underwood Aug 31 '21 at 19:55