curiousdannii / parchment

The Interactive Fiction web app
https://iplayif.com
MIT License
430 stars 60 forks source link

Character input doesn't work in mobile Chrome #26

Closed qdacsvx closed 2 years ago

qdacsvx commented 8 years ago

http://iplayif.com/?story=http%3A%2F%2Fwww.ifarchive.org%2Fif-archive%2Fgames%2Fzcode%2Fdegen.z5 After entering the command HELP to open a help menu, the interface switches to single keypress mode. However, on Android, using Parchment in mobile Google Chrome, the virtual keyboard can be popped up but touching a key (a single keypress) fails to activate a command. Because commands can't be activated, it is not possible to exit help.

Running Frotz on the same device, running the same game, touching a single key does activate a command. Help can be exited as expected.

Bug can also be observed in Quixe e.g. https://dl.dropboxusercontent.com/u/23390721/Release/play.html

curiousdannii commented 8 years ago

So apparently Chrome has never properly supported keypress: scottjehl/Device-Bugs/issues/20, Chromium bug I wouldn't have noticed until recently though because on my old phone I used the Android browser rather than Chrome.

And it turns out that the keypress event is actually deprecated now?!

qdacsvx commented 8 years ago

The same bug occurs in mobile Firefox.

cibersheep commented 7 years ago

Same behavior on Ubuntu Touch (default browser is Oxide, a fork of Chromium(

WakeRealityDev commented 7 years ago

With a USB, Bluetooth or other "hard keyboard" on Android 7, the 'char input' menu in degen.z5 works fine for me on Android 7's Chrome browser.

Maybe an alternate soft keyboard works around the issue? It could be a lack of input focus on where the keystrokes are going (there is no blinking cursor anywhere, see also issue #27). Maybe an explicit JavaScript call to put focus somewhere could be added? Maybe a transparent html input or textarea tag ?

curiousdannii commented 2 years ago

Character input is working in my new AsyncGlk library, which you can test here (note many other things are not implemented yet):

https://curiousdannii.github.io/parchment-testing/?story=https://ifarchive.org/if-archive/games/zcode/Savoir-Faire.zblorb

One limitation is that there is no way I can see of supporting function keys with a mobile virtual keyboard. It would be possible to add our own extra menu for function keys though.