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:
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.
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?
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.)
It does not, as discovered by one of my testers. So I’m going to have to remove all the (any key) queries to make the game be playable with hyperlinks alone (since that’s one of my main goals).
Unfortunately, (get input $) and (get key $) both block until they get what they’re looking for, so there’s no way to run both of them at the same time.
My current solution is this:
(any key or link)
(if) (interpreter supports links) (then)
(if) (interpreter supports inline status bar) (then)
(inline status bar @inlinebar) {
(link [\* \* \*]) { \[\[Continue\]\] }
}
(else)
(link) { \* \* \* }
(endif)
(get input $) %% Just wait for a link to be clicked, then continue
(else)
(any key)
(endif)
In other words, if the interpreter supports links, show a “continue” link, using an inline status bar to make it disappear afterward if possible. Then use (get input $) to wait for hyperlink input. Otherwise, wait for keypress input.