Glulx Input Loops

version 1/101121 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next

  • Section: Event types

    We can also specify a "focal event type". This is the type of input event that the loop is primarily intended to handle; that is, the input type that the loop requests at the outset. It can be changed while the game is in progress. Here is the definition of hyperlink loop again, this time with the focal event specified:

        Hyperlink input is an input-loop. The focal event type is hyperlink-event.

    Event types are specified using the "g-event" kind of value. The standard options are:

        line-event: Standard command line input, from a text-buffer or text-grid window.
        char-event: Keystroke input, from a text-buffer or text-grid window.
        hyperlink-event: Text hyperlink, from a text-buffer or text-grid window.
        mouse-event: Mouse input, from a graphics or text-grid window.

    These are the input events, but it is also possible--though unlikely to be useful--to set up an input loop that waits for *any* kind of event. The remaining event types are these:

        arrange-event: The player has resized the window.
        redraw-event: The windows need to be resized thanks to some event such as the monitor resolution changing.
        timer-event: The timer has fired.
        sound-notify-event: A sound has stopped playing.