rv32-sail
rv32-sail copied to clipboard
iOS Shenanigans
Issue description
Somehow, the WebAssembly build, including all the service worker stuff, actually works on iOS. I even ran CoreMark! Perhaps not surprisingly (due to the origins of Blink), it actually seems to somehow work better than Firefox(?!), although there are still some glitches:
- There is some terminal code/character output glitching in the ASCII Art, on the Computer (see below)
- Scrolling does not work. Otherwise, it would probably work on my iPhone too, but the lack of scrolling makes it impossible to scroll down and thus see any output.
- There is an ritual needed to get the actual keyboard to appear upon tap. I'm not sure how to enable focus for these cases so that the keyboard opens.
Steps to reproduce
I think the ritual is: open the page on your device using Safari. Then, swipe "up" to use the app switcher and select any other app. Then, do that again, but go back to Safari. The keyboard will appear, although it will not auto-focus on the input prompt line -- so you are probably going to type blind, as the keyboard will overlay the prompt. Afterwords, you can hit the "Hide Keyboard" shortcut to make the keyboard go away and see the output.
I assume the logic here is something like this:
- When you first load the page, there is no textinput prompt for you to use keyboard input on.
- The page dynamically injects the hterm library, which brings up the prompt and installs the keyboard upon load.
- When you do the whole app-switcharoo, and move back to Safari, there is now a keyboard input textarea available -- so Safari auto-opens the keyboard for you, helpfully.
So I think what needs to happen is:
- We need to trigger some kind of keyboard focus event when the user taps, perhaps? And on first load, after the page is ready.
- We also need to auto-focus the prompt line when the user taps/loads, so that the keyboard doesn't overlay the prompt, and allows you to see properly.
Technical details
iOS 2.1.3, 9.7 inch "New" iPad (non-Pro).