6 Branching and Subroutines

The KEYBD function

NOTE: The KEYBD function is not available when working with the graphical user interface and so it is not supported on Windows platforms.

ON KEYBD

The ON KEYBD statement makes it possible to use arbitrary keys like functions keys.

Syntax:

ON KEYBD #n[,#n...][,priority] {GOTO|GOSUB|CALL} target

NOTE: Key numbers are defined by curses and returned by the KBCODE keyword. You can't catch the break key (key number 0).
There is a maximum of 32 active ON KEYBD in one program segment
An ON KEYBD statement overrides any default sense of the key. Catching an important
key (like carriage return) may result in a unusable keyboard within Eloquence

NOTE: A lot of special keys makes it hard to remember for the user, which keys are active or what keys result in what function. It's most likely a bad idea to catch any regular characters or control characters. If you catch some special keys (for example next line), the program reaction should be closely implied by the key.

OFF KEYBD

The OFF KEYBD# removes the interrupt handling for the specified key or all keys, if no key number has been specified.

Syntax:

OFF KEYBD #[n [,n . . .] ]


Eloquence Language Manual - 19 DEC 2002