Cicode Programming Reference > Cicode Function Categories > Keyboard Functions Introduction > KeyPeek

KeyPeek

Gets the ascii key code from the key command line (at a specified offset), without removing the key from the key command line. An offset of 0 returns the key code from the last position in the key command line.

Syntax

KeyPeek(Offset)

Offset:

The offset from the end of the key command line

Return Value

The ASCII key code.

Related Functions

KeyGet

Example

! If "A B C" is in the key command line:
Variable=KeyPeek(0);
! Sets Variable to 67 (ASCII "C")
Variable=KeyPeek(2);
! Sets Variable to 65 (ASCII "A")

See Also

Keyboard Functions