Skip to content

Apple iPad - Smart Keyboard Arrows#1064

Closed
exsilium wants to merge 1 commit into
xtermjs:masterfrom
exsilium:iPadHWArrows
Closed

Apple iPad - Smart Keyboard Arrows#1064
exsilium wants to merge 1 commit into
xtermjs:masterfrom
exsilium:iPadHWArrows

Conversation

@exsilium

Copy link
Copy Markdown
Contributor

Hi! It was a pleasant surprise to find out that xterm.js mostly works out of the box with Apple's Smart Keyboard using iPad iOS 11. However, the arrows don't work. Let me know if the main code is not a place for such platform specific mappings. 🍻

  • Arrows trigger keydown event
  • keyCode == 0, always.
  • The actual key pressed is identified via key strings:
    • UIKeyInputUpArrow
    • UIKeyInputLeftArrow
    • UIKeyInputRightArrow
    • UIKeyInputDownArrow

I'm not sure how Android does it and if this is truly iPad specific or not. I'm also not sure if this truly should be part of the main xterm code, or just handled separately via addon/application layer when useragent is identified as iPad.

@parisk parisk self-assigned this Oct 15, 2017
@parisk

parisk commented Oct 15, 2017

Copy link
Copy Markdown
Contributor

@exsilium can you please rebase the PR to use v3 as the base branch? This is the current branch where we introduce new functionality.

Then I will give it a go on my device.

Also, do you have any public documentation available for these key names in Safari?

@exsilium

Copy link
Copy Markdown
Contributor Author

@parisk, thanks, will do! In fact, I did try v3 to begin with, but there seems that there are some interface changes comparing with v2 as it broke my integration with cloud9. I need to look into that first.

As for the documentation - I have yet to find the official source. I was looking via console to see what (if any) keydown/keypress event is triggered by the arrows. I also noticed that the key strings passed match with the ones defined in UIKit documentation, except they also define one string for escape key, a key which is lacking on the smart keyboard 😲 (maybe for the future?)

For a full event example being sent by the arrows, see this comment

@exsilium

Copy link
Copy Markdown
Contributor Author

I resubmitted this against v3 as #1065 , feel free to close this one, as v2 is feature-locked.

@parisk parisk closed this Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants