Glulx Input Loops

version 1/101121 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - New HandleGlkEvent routine

    Glk input context is a g-event variable. [This is available as a hook for authors—it is filled with the focal event type of the loop in which input was received.]

    To decide what number is the value returned by glk event handling:
        now glulx replacement command is "";
        follow the glulx input handling rules for the current glk event;
        if the outcome of the rulebook is the replace player input outcome:
            return input replacement;
        if the outcome of the rulebook is the require input loop to continue outcome:
            return input continuation;
        follow the command-counting rules;
        if the rule succeeded:
            follow the input-cancelling rules;
            follow the command-showing rules;
            follow the command-pasting rules;
            if the rule succeeded:
                return input replacement.