Closed laserlemon closed 1 year ago
Maybe we could use "Space"
as a way to distinguish space as a separator of key sequences (" "
), and the literal space key as a shortcut ("Space"
).
So for example the shortcut key to open Spotlight / Alfred / Raycast on a Mac would be "Meta+Space"
.
This actually relates to https://github.com/github/hotkey/issues/54#issuecomment-992997472 where I suggest we match on event.code
rather than event.key
. The event.key
for space is " "
: the event.code
is "Space"
, so making that breaking change would also resolve this issue.
If we don't make that change, then this would require some special code.
Updated this issue to also cover Plus
(because Mod++
isn't great).
Typo prevented this from properly closing when it was merged. It was released in 2.3.0
It seems that the
eventToHotkeyString
function returns" "
for a spacebar keystroke, as described in the key values docs. But theexpandHotkeyToEdges
function also uses the space character to split hotkey combinations.So how might one define a single hotkey or hotkey combination containing a space?
We might consider a slight deviation from the key values docs in this instance to add the Space shorthand as an alias for
" "
when defining a hotkey via thedata-hotkey
attribute orinstall
function. Thank you! 💛