Convert Ink's (input, key) event into a list of possible key-name
strings for matching.
When a modifier (ctrl, shift, meta) is held, the bare key name is
excluded so that modified keys (e.g. "shift+tab") do not accidentally
trigger bindings registered for the bare key alone (e.g. "tab").
The character part of a modifier variant is lower-cased before the prefix
is added: Ink reports a shifted key as the form it produces, so Shift+S
arrives as "S" and normalizes to "shift+s". Bare (unmodified) input keeps
its original spelling.
Junk key values (undefined, null) read as a descriptor with no flags, so
a plain character input still normalizes to its bare name.
Parameters
input: string
Raw character string from Ink's useInput (empty for special
keys; a shifted letter arrives as the uppercase character it
produced, e.g. "S" for Shift+S).
Convert Ink's
(input, key)event into a list of possible key-name strings for matching.When a modifier (ctrl, shift, meta) is held, the bare key name is excluded so that modified keys (e.g. "shift+tab") do not accidentally trigger bindings registered for the bare key alone (e.g. "tab").
The character part of a modifier variant is lower-cased before the prefix is added: Ink reports a shifted key as the form it produces, so Shift+S arrives as "S" and normalizes to "shift+s". Bare (unmodified) input keeps its original spelling.
Examples: press('s', { ctrl: true }) → ["ctrl+s"] press('S', { shift: true }) → ["shift+s"] press('', { escape: true }) → ["escape"] press('', { return: true, shift: true }) → ["shift+return"] press('', { tab: true }) → ["tab"] press('', { tab: true, shift: true }) → ["shift+tab"]
Junk
keyvalues (undefined, null) read as a descriptor with no flags, so a plain character input still normalizes to its bare name.