Glulx Input Loops

version 1/101121 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Basics of input handling

    Nearly all input--regardless of whether it is standard typed input, hyperlink input, or mouse input in a graphics window--occurs while Inform is waiting for "line input"; that is, for input at the command line prompt. Inform's standard library handles this input according to the following flow:

        1) Input is requested in the appropriate window (the main-window).
        2) Wait for input; the game is paused until an event is received.
        3) The library does very minimal handling of the input event.
        4) The event is then passed off to user event handling rules (the Glulx Entry Points extension provides a framework for handling these events).
        5) If the event results in usable input (a command), the loop is ended and the command is passed on to other routines for parsing.
        6) Otherwise, we return to step 1 and try again.

    Glulx Input Loops follows this same basic outline, but adds new hooks for user customization at every point, as well as providing ways for input loops to "nest" inside of other input loops. There are a number of concepts and terms to be laid out first, but you can see the full event flow that Glulx Input Loops provides later on.

    Input, and particularly Glulx input, is a complicated topic, and this short documentation has no aspirations to explain it fully. This extension is thus intended for intermediate to advanced authors. Those who need more information about Glulx and input handling generally will find these sites useful:

        http://www.iffydoemain.org/glkdunces/index.htm
        http://adamcadre.ac/gull/
        http://eblong.com/zarf/glulx/