Lately, I have been experimenting with coding with an iPad Pro with a Smart Keyboard on SourceLair.
The experience was buggy, but honestly it was much better than I expected.
One of the caveats (initially pointed out by @Exsillium in a different PR) is that the arrows of the Smart Keyboard do not work at all on xterm.js.
It would be great if they did though 😄!
Initial discussion and PR with partial solution: #1065
Initial approach
At first we tried to fix this by detecting the keydown events of the Smart Keyboard and then handle them in xterm.
This did not work, as the only case where iOS fires consistently keyboard events on Smart Keyboard
arrow presses is the keydown event, when the focus is on document.body.
Potential solution
- Use the terminal's hidden textarea
- Let iOS handle the keyboard event natively
- Detect the keyboard movement via selection change
Proof of Concept: How Ace editor handles this
https://github.com/ajaxorg/ace/blob/eb2437badf4013893e15cb873057607c09cc95ae/lib/ace/keyboard/textinput_ios.js#L483-L526
Lately, I have been experimenting with coding with an iPad Pro with a Smart Keyboard on SourceLair.
The experience was buggy, but honestly it was much better than I expected.
One of the caveats (initially pointed out by @Exsillium in a different PR) is that the arrows of the Smart Keyboard do not work at all on xterm.js.
It would be great if they did though 😄!
Initial discussion and PR with partial solution: #1065
Initial approach
At first we tried to fix this by detecting the keydown events of the Smart Keyboard and then handle them in xterm.
This did not work, as the only case where iOS fires consistently keyboard events on Smart Keyboard
arrow presses is the
keydownevent, when the focus is ondocument.body.Potential solution
Proof of Concept: How Ace editor handles this
https://github.com/ajaxorg/ace/blob/eb2437badf4013893e15cb873057607c09cc95ae/lib/ace/keyboard/textinput_ios.js#L483-L526