Replies: 2 comments
-
|
Additional links and implementations for reference. We could use This may make it harder to use that symbol for some other seperator in the future though. Alpine.jsInterestingly, Alpine.js does not have this feature - https://alpinejs.dev/directives/on#keyboard-events HotkeyNot implemented, but has a PR up for this capability. Hotkey-jshttps://github.com/jaywcjlove/hotkeys-js Mousetrap
Tinykeys
|
Beta Was this translation helpful? Give feedback.
-
|
PR up to implement this feature #715 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I believe there is a common pattern to modify some keydown events using a different key on Mac and Windows operating systems. The one I see most commonly is using
CMD+Enteron Mac andCTRL+Enteron Windows in order to submit a form while typing in a textarea.I know that the
data-actionattribute on an element can take multiple actions; so, I could, in theory, achieve this as follows:But, considering that I'd want to use this pattern in many places, this seems verbose.
My next thought was to register a custom keydown filter -
mod- as follows:... with the hope being that I could use something like
keydown.mod+enterwhere it would be evaluated asmeta+enteron Mac andctrl+enteron Windows. But, unfortunately, it looks like modifier keys are handled separately from the custom key mappings.So, my thought would be to have Stimulus add a new modifier call
modormodifythat would be the cross-platform evaluation.Anyway, just throwing that out there. I raised it on the Hotwired community forum, and I tried Googling for it, and I didn't see anyone discussing this anywhere.
Beta Was this translation helpful? Give feedback.
All reactions