ink
ink copied to clipboard
useInput meta + delete key combo missing delete flag
When pressing delete
and meta
key (in this case cmd key on macOS) the key object from useInput is missing the delete
flag.
Is this expected behaviour? I would expect the delete flag to be true both times as it is being pressed both times
Example:
Regular Delete (backspace on macOS) press
{
"upArrow": false,
"downArrow": false,
"leftArrow": false,
"rightArrow": false,
"pageDown": false,
"pageUp": false,
"return": false,
"escape": false,
"ctrl": false,
"shift": false,
"tab": false,
"backspace": false,
"delete": true,
"meta": false
}
Delete while holding Meta key
{
"upArrow": false,
"downArrow": false,
"leftArrow": false,
"rightArrow": false,
"pageDown": false,
"pageUp": false,
"return": false,
"escape": false,
"ctrl": false,
"shift": false,
"tab": false,
"backspace": false,
"delete": false,
"meta": true
}```
Also adding additional key combos not handled, like ctrl+return and shift+return. I think the input handling cribbed from the keypress
module is not so sound, and that repo seems abandoned.
This is certainly a bug, I'd appreciate a PR with a fix for this if you're in the mood for it ;)
I gave it a shot today and turns out cmd
+ delete
doesn't trigger any input whatsoever in iTerm or in built-in Terminal app. And ctrl
+ return
and shift
+ return
always trigger \r
, which is a regular return
, so it's impossible to detect if ctrl
or shift
was pressed.
Going to close this for now unless there's more information I'm missing.