Navigation

Operators and Keywords

Function List:

C++ API

: kbhit ()
: kbhit (1)

Read a single keystroke from the keyboard.

If called with an argument, don’t wait for a keypress.

For example,

x = kbhit ();

will set x to the next character typed at the keyboard as soon as it is typed.

x = kbhit (1);

is identical to the above example, but doesn’t wait for a keypress, returning the empty string if no key is available.

See also: input, pause.

Package: octave