key-codeReturns character sequences for any key pressed (ie sent from the terminal)
key-code is a tool used for querying what byte sequence
the terminal emulator
key-code -> <stdout>
<stdin> -> key-code -> <stdout>
» key-code
Press any key to print its escape constants...
…then press [f9] and key-code returns…
ANSI Constants: {F9}
Byte Sequence: %[27 91 50 48 126]
Contains Unicode: false
» tout str '{ESC}[20~' -> key-code
ANSI Constants: {F9}
Byte Sequence: %[27 91 50 48 126]
Contains Unicode: false
If stdout is not a TTY then only the thing written is the ANSI Constant. This is so that it can be used as a variable. eg
key-code -> set $key
event onKeyPress close=$key {
exit
}
event: Event driven programming for shell scriptstout: Print a string to the stdout and set it’s
data-typeonKeyPress:
Custom definable key bindings and macrosThis document was generated from builtins/events/onKeyPress/keycodes_doc.yaml.
This site's content is rebuilt automatically from murex's source code after each merge to the master branch. Downloadable murex binaries are also built with the website.
Last built on Mon Oct 12 23:53:07 UTC 2026 against commit 6332fa16332fa1e89d3a5df5c6104d7f19d017367bb74f9.
Current version is 7.3.1232 (unknown) which has been verified against tests cases.