Skip to content

Glk 071 draft spec changes

erkyrath edited this page Jan 12, 2011 · 16 revisions

Line input echoing

By default, when the player finishes his line of input, the library will display the input text at the end of the buffer text (if it wasn't there already.) It will be followed by a newline, so that the next text you print will start a new line (paragraph) after the input.

However, this default behavior can be changed with the glk_set_echo_line_event() call. If the default echoing is disabled, the library will not display the input text (plus newline) after input is either completed or cancelled. The buffer will end with whatever prompt you displayed before requesting input. If you want the traditional input behavior, it is then your responsibility to print the text and newline, using the Input text style.

The glk_set_echo_line_event() call has no effect in grid windows.

void glk_set_echo_line_event(winid_t win, glui32 val);

Normally, after line input is completed or cancelled in a buffer window, the library ensures that the complete input line (or its latest state, after cancelling) is displayed at the end of the buffer, followed by a newline. This call allows you to suppress this behavior. If the val argument is zero, all subsequent line input requests in the given window will leave the buffer unchanged after the input is completed or cancelled; the player's input will not be printed. If val is nonzero, subsequent input requests will have the normal printing behavior. Note that this feature is unrelated to the window's echo stream.

If you turn off line input echoing, you can reproduce the standard input behavior by following each line input event (or line input cancellation) by printing the input line, followed by a newline, in the Input style.

The glk_set_echo_line_event() does not affect a pending line input request. It also has no effect in non-buffer windows. In a grid window, the game can overwrite the input area at will, so there is no need for this distinction.

Unicode decompose/normalize

Clone this wiki locally