Should hyperlinks count as pressing a key?

This is really more of an Å-machine question than a Dialog question, but as far as I know Dialog is the only system that compiles to the Å-machine, so.

Does the standard say anything about whether a hyperlink should satisfy a keypress input? For example:

(any key)
    (link [@s]) { \( Press any key. \) }
    (get key $)

You may have found out the same thing that me already, but anyway.

As far as I can see, the standard says nothing about it. Of the functions that control the I/O state (like creating a hyperlink), it only says:

The exact meaning of each of the above API calls is not specified here. It is up to the output subsystem of the interpreter to react to them in some sensible way.

The Dialog documentation says:

Clicking on the text has the same effect as typing the words THE LINKED TEXT and pressing return. […] Note that the words are appended to the end of the current contents of the input buffer.

So my interpretation is: according to the spec, an interpreter could have a hyperlink making a keypress if it wanted, but games made with Dialog shouldn’t rely on it – except maybe if you will always bundle with your custom interpreter, à la Vorple. Or you could just say it’s not well specified.

Also, what would happen if the link submits not a single character but a full command?

2 Likes

That’s the sort of thing I’m wondering about, yeah. I’m a fan of waiting for a keypress before clearing the screen, but on a phone that can be very annoying. So I’d be much more willing to use (any key) if I could be confident that any interpreter that supports links can also let a link substitute for a keypress. (If someone’s playing with an interpreter that doesn’t support links, then they’ll have to have their keyboard open anyway, so I’m not worried about that.)

What about the JS interpreter provided by aambundle? Does it generate a keypress upon clicking a link?