Glulx Input Loops
version 1/101121 by Erik Temple
Documentation
- Chapter: Creating input loops
- Chapter: Invoking an input loop
- Chapter: Input loop rulebooks
- Chapter: Primary and secondary input loops
- Chapter: Modifications to Glulx Entry Points (the glulx input handling rules)
- Chapter: Event loop flow
- Chapter: Debugging
- Example: * Any Key to Continue - In this example, we use the character input loop to require the player to press a key to begin playing; we also echo the key pressed.
- Example: * No Typing Allowed - This simple example illustrates how to alter the main input loop to accept hyperlink input in lieu of line input. The hyperlink input requests and command replacement are handled automatically by the Inline Hyperlinks extension, so there is no need to use the input loop setup rules (see above).
- Example: *** Under Doom - The primary intention of this example is to demonstrate the use of a secondary input loop (running within the main input loop). It also shows how to reconfigure the main input loop to use character (single-keystroke) input rather than the default line input, how to use the input loop setup rules, and how to create and use new input loops.
Glulx Input Loops replaces Inform's main input loop with a more flexible framework, and also allows us to create our own named input loops. Input loops are handled in such a way as to minimize the possibility of input events nesting in situations where one event immediately triggers another (these will be an issue only when we are doing something really radical). Also alters the internal workings of Glulx Entry Points to provide somewhat more flexible event handling (existing code written for use with GEP should need no changes).
Glulx Input Loops requires Jon Ingold's Flexible Windows extension, and includes it automatically. However, an obscure bug in Inform sometimes causes problems if we do not also include Flexible Windows in our story text, before including Glulx Input Loops, like so:
Include Flexible Windows by Jon Ingold.
Include Glulx Input Loops by Erik Temple.
Glulx Input Loops does not require Emily Short's Basic Screen Effects, but is compatible with it. However, Glulx Input Loops must be included after the latter or some features to do with keypress input will not work properly, e.g.:
Include Flexible Windows by Jon Ingold.
Include Basic Screen Effects by Emily Short.
Include Glulx Input Loops by Erik Temple.