intfiction.org

The Interactive Fiction Community Forum
It is currently Wed Jul 26, 2017 3:30 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
PostPosted: Tue Apr 18, 2017 3:49 pm 
Offline

Joined: Mon Nov 19, 2012 4:51 pm
Posts: 191
Location: UK
Basic Help Menu by Emily Short triggers a bug in Parchment which makes help unusable on mobiles. The bug is over a year old and has no prospect of being fixed. Authors are working around this by deleting help from games. An update to Basic Help Menu which doesn't trigger the bug would be appreciated.


Top
 Profile Send private message  
 
PostPosted: Tue Apr 18, 2017 10:00 pm 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2373
Location: The Midwest
This is unfortunately difficult to work around without breaking menus entirely, and affects many things apart from menus: anything that listens for keypress input triggers it. The best option would probably be to fix Parchment to wait for a full line of input if keypresses aren't supported.

_________________
Daniel Stelzer


Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 4:07 am 
Offline

Joined: Mon Nov 19, 2012 4:51 pm
Posts: 191
Location: UK
I agree with Draconis in general, that fixing one extension but not the keypress bug would leave the bug to cause problems elsewhere.

The current design of Basic Help Menu to use keyboard navigation for reading help documents isn't suitable for devices without a keyboard. Even if there was no keypress bug, a touchscreen typically allows keyboard input by drawing a keyboard image on the screen; you can touch the image of a key to accomplish a key press. However, the image of the keyboard must be large enough that you can reliably touch a single key and it must be displayed whenever a keypress is needed - all the time with keyboard navigation; on a small device like a mobile phone, the keyboard image covers all or most of the screen obscuring the document and making reading inconvenient or impossible.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 8:08 am 
Offline
User avatar

Joined: Fri Sep 30, 2016 7:02 pm
Posts: 326
Location: USA
I put a new comment on the bug report - as I tested on Google Chrome on Android - and in my personal testing - it works fine if you use a hard keyboard (USB, Bluetooth, etc). It looks to me that the problem is that there is no focus area for the soft keyboard - there is another open bug with similar issues. There is no text box to type into - so the soft keyboard is throwing keystrokes into useless parts of the web browser. I suggested a transparent input field or other change. There might even be alternate soft keyboard apps that know how to work around such designs.

_________________
Glulx interpreter Android apps are in open beta testing! Three apps to watch for: Incant!, Thunderword, and Thunderword enhanced Text Fiction.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 8:24 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2379
Even if you're typing into a text box, Chrome will not send keypress events. Work arounds are probably possible using keydown or other events. Pull requests are very welcome!

Using another keyboard may help, but is not a solution to the problems in Parchment and Quixe, which are in fact using a depreciated function (keypress events).


Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 8:27 am 
Offline
User avatar

Joined: Fri Sep 30, 2016 7:02 pm
Posts: 326
Location: USA
Dannii wrote:
Even if you're typing into a text box, Chrome will not send keypress events. Work arounds are probably possible using keydown or other events. Pull requests are very welcome!

Using another keyboard may help, but is not a solution to the problems in Parchment and Quixe, which are in fact using a depreciated function (keypress events).


But, my point stands, without any change to the code at all - a hard keyboard works. So Chrome must be sending it... The issue isn't purely just Chrome --> Javascript API, or a hard keyboard wouldn't work on Android. This sort of problem shows up in non-Chrome apps on Android - there is an open bug on Text Fiction (which doesn't use Javascript at all). Were is the focus? Where are the keystrokes going? The soft keyboard on mobile is tricky because it tries to go away - which on a normal desktop PC isn't normal behavior (imagine a user constantly unplugging their USB keyboard). If focus doesn't account for this - it can turn into problems. I've seen Parchment and Quixe have problems just by minimizing and alt-tab on a desktop - it can start throwing errors about input focus and confusion of which Glk window.

_________________
Glulx interpreter Android apps are in open beta testing! Three apps to watch for: Incant!, Thunderword, and Thunderword enhanced Text Fiction.


Last edited by allensocket on Wed Apr 19, 2017 8:32 am, edited 1 time in total.

Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 8:32 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2379
Right, soft keyboards won't send all the events a hard keyboard (or alternative keyboard app) would, and the Chrome team, unlike the Firefox for Android and possibly Safari teams, have decided not to send mock keypress events.

Requiring another keyboard is not an acceptable solution for Parchment. But using keydown or input events should make it possible to send most keypresses to the VM, except perhaps for backspace.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 8:48 am 
Offline
User avatar

Joined: Fri Sep 30, 2016 7:02 pm
Posts: 326
Location: USA
Dannii wrote:
Right, soft keyboards won't send all the events a hard keyboard (or alternative keyboard app) would, and the Chrome team, unlike the Firefox for Android and possibly Safari teams, have decided not to send mock keypress events.

Requiring another keyboard is not an acceptable solution for Parchment. But using keydown or input events should make it possible to send most keypresses to the VM, except perhaps for backspace.


I'm not suggesting requiring another keyboard as a solution (at best, it is a "workaround" - that should be shared openly with others); In fact, my suggestion was to experiment with creating a transparent (or semi-transparent) textarea input field when there is otherwise no place to touch the focus and wire that input field (JavaScript) into the interpreter. My point of bringing up the hard keyboard is that it points out that the JavaScript API being absent isn't as obvious to me as it seems.

Those special keys are secondary topic to me. I'm not talking about special keys. The menu being cited in this topic allows normal keys like "P", "Q" and "N" - and those were the ones I tested. And, people reported Firefox has the same problem as Chrome (qdacsvx commented on Mar 2, 2016), so I'm skeptical that it's an issue of this one specific JavaScript API alone. It seems to be a classic case of no focus. There is no blinking cursor on the screen when this menu is up; where are the keystrokes going?

Regarding that secondary topic: I agree with you that there is a whole different mess with special keys on mobile. Especially things like cursor arrow keys or F1-F12 to navigate a menu - as most soft keyboards don't present these. That's not why I brought up a full 102-key hard keyboard (which has those keys), as I'm talking about routine keys like "N" and "Q" that the cited story offers in it's menu system.

_________________
Glulx interpreter Android apps are in open beta testing! Three apps to watch for: Incant!, Thunderword, and Thunderword enhanced Text Fiction.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 9:04 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2379
Quote:
It seems to be a classic case of no focus. There is no blinking cursor on the screen when this menu is up; where are the keystrokes going?
To the textbox which is hidden through absolute positioning -999em to the left.

I'm pretty sure the issue is Parchment's reliance on keypress events. But I wrote that code 6 years ago and have hardly touched it since, and don't remember all the hacks and intricacies it has. It would probably be better to start from scratch using the newer browser APIs. Or just fix it in GlkOte, because I'm already planning to switch to using GlkOte.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 9:35 am 
Offline
User avatar

Joined: Fri Sep 30, 2016 7:02 pm
Posts: 326
Location: USA
My concern is that this specific Chrome API is being blamed. But I've worked with Twisty 2.0, Text Fiction, Incant!, and Thunderword - and this problem comes up on mobile -with zero involvement of Google Chrome or Mozilla Firefox. Mobile is not trivial to get keystroke input right, it isn't that Google is out to break things. In my own counting, Text Fiction is the most popular app for Android to play IF - and guess what - the author made a keyboard app for it! An entire app whose purpose is to help with the keyboard. My sense and experience is that it's a complexity of mobile and Glk in general. Menus and 'press key to continue', in particular, are a real difficult area. It was just a few weeks ago that I added keystrokes to the mostly-complete Incant! app (which has Glk sound and a lot of other very complete features). The original author skipped keystroke input. Just 48 hours ago I had to rework Twisty 2.0's keystroke input to allow you to exit the app! cite: https://github.com/WakeRealityDev/twist ... 71d5888R86 -- this took me over an hour just to track down where it was eating the exit button on the phone.

_________________
Glulx interpreter Android apps are in open beta testing! Three apps to watch for: Incant!, Thunderword, and Thunderword enhanced Text Fiction.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group