curiousdannii / infocom-frotz

Online player for Infocom's Z6 games
https://curiousdannii.github.io/infocom-frotz/
GNU General Public License v2.0
0 stars 0 forks source link

Fake keyboard for function keys #7

Open dfabulich opened 1 month ago

dfabulich commented 1 month ago

Arthur has a system where you press F1, F2, etc. to switch between modes. (Graphics, Map, Inventory, Score, Room Description, and Text Only.)

Fn keys can be difficult to type on modern keyboards, and impossible to use on mobile keyboards.

I think Arthur should have on-screen buttons that send the appropriate Fn keystrokes to Frotz.

dfabulich commented 1 month ago

The difference between #7 and #8 in my mind is that I thought it would be better if Infocom Frotz had different UI for different games.

For example, Journey doesn't offer Fn buttons to switch between modes, but does benefit from arrow keys, so Journey's UI could have arrow keys, but no Fn buttons, and Arthur could have Fn buttons but no arrow keys.

As I'm imagining it, the Arthur buttons wouldn't say [F1] [F2] [F3] etc. but rather [Graphics] [Map] [Inventory] [Score], etc.

curiousdannii commented 1 month ago

Ooohh. Wow, I had no idea Arthur even had a map!

I had been thinking of adding a generic function keys fake keyboard, like I want to for Parchment (https://github.com/curiousdannii/asyncglk/issues/3). But it sounds like a more tailored solution would be better here. the buttons for Arthur might make more sense being on top for example. I'd probably still use the same system underneath them though.

Would Zork Zero or Shogun benefit from anything?

dfabulich commented 1 month ago

Shogun and Zork Zero both use the Fn keys as remappable "shortcut keys." Try typing DEFINE on the Zork Zero command line to see how it works. https://infodoc.plover.net/manuals/temp/zork0.pdf

I don't really care for it, personally. I don't think it's worth adding extra Fn buttons for those games. But I absolutely do think that Fn buttons make sense for Arthur, and I'd want them visible not just on mobile, but on all platforms, because the modes feature is totally undiscoverable otherwise.

As for the arrow keys, well, the arrow keys do what they always do in these games. Left and right moves the cursor (which can be quite handy on mobile keyboards), and up / down will let you navigate through your history of previous commands.

But having on-screen arrow buttons would be especially valuable in Journey. I think that would make Journey "actually playable" on mobile, even without fixing #1, as opposed to how it stands now, where the options are really much too small to tap.

curiousdannii commented 1 month ago

I wonder if Frotz could send a signal for when it's in line input mode compared to keypress mode. Maybe it would be possible to let the phone's IME do autocompletes and spellchecks that way. I don't know if I want to spend that much time on it though... but I guess I'll make an issue for it. Arrows in the meantime is very doable though.

Also, note that #1 is just about buttons in the save/restore dialog. I wouldn't want to even attempt to try to change the layout of the games themselves.

curiousdannii commented 1 month ago

I added mode buttons for Arthur! It's really using all the available space now.

Screenshot_20240524-135648