erkyrath / quixe

A Glulx VM interpreter written in Javascript
http://eblong.com/zarf/glulx/
MIT License
169 stars 33 forks source link

Touch focus events #35

Open curiousdannii opened 7 years ago

curiousdannii commented 7 years ago

Currently in Quixe, you must tap the input box precisely in order to bring up the soft keyboard. It would probably be better to allow the user to tap anywhere in a window to focus the input (compare with Parchment which does this.)

If the input is already focused, tapping the window elsewhere will hide the keyboard and then show it again. This is far from ideal! Tapping the window should either not affect the soft keyboard, or it should hide the keyboard. It may not be possible to do the first, so perhaps tapping the window could toggle the keyboard on and off.

erkyrath commented 7 years ago

We'd have to test how this affects all the other things you can do by tapping a web page, such as selecting and scrolling.

nebocamin commented 7 years ago

I am not sure if it fits into this issue.

the inform 7 line "pause the game;" is waiting for an event that you can't do with android virtual keyboard for example. So you will stuck forever. But "wait for any key;" is working.

curiousdannii commented 7 years ago

That would be because keyboard input is not currently working: it returns some invalid keycode number, which will work for the "wait for any key" phrase, but not the "pause the game" phrase which waits specifically for the space key.

cibersheep commented 6 years ago

This is an interesting issue. 1) I don't know if it's easy to differentiate the input. A dirty hack could be, convert the «press SPACE key» into a link. or 2) Searching a bit, I've found that this. Even if I don't use Android nor iOS, on Ubuntu Touch is also the same behaviour. Would be possible to use textInput as a workaround?

Note: keyup is 229 but in the screenshot is 175 (the button I pressed to make the screenshot :D ) imatge

cibersheep commented 6 years ago

I got a solution! It was easier than I thought. I was obsessed with ev.wich and similar and the answer is the actual text. So in evhan_input_char_keydown I created a new case 229: res=$("input").val()[0]; that easy. It took me two days