DMCP interface  03.15_020
Basic functions

Basic keyboard functions. More...

Functions

int key_empty ()
 Check whether key buffer is empty. More...
 
int key_push (int k1)
 Push key at the end of key buffer. More...
 
int key_tail ()
 Check for key in key buffer. More...
 
int key_pop ()
 Remove and return next key from key buffer. More...
 
void key_pop_all ()
 Remove all keys from key buffer.
 
int key_to_nr (int key)
 Returns corresponding number for key code key. More...
 
int sys_last_key ()
 Returns currently pressed key code. More...
 
void wait_for_key_press ()
 Wait for key press. More...
 
void wait_for_key_release (int tout)
 Wait for key release or timeout. More...
 

Detailed Description

Basic keyboard functions.

Function Documentation

◆ key_empty()

int key_empty ( )

Check whether key buffer is empty.

Returns
(0/1) 1 = Key buffer empty

◆ key_pop()

int key_pop ( )

Remove and return next key from key buffer.

Returns
Next key in key buffer or -1 if buffer is empty

◆ key_push()

int key_push ( int  k1)

Push key at the end of key buffer.

Parameters
k1Key to store
Returns
(0/1) 1 = success, 0 = buffer full

◆ key_tail()

int key_tail ( )

Check for key in key buffer.

Returns
Next key in key buffer or -1 if buffer is empty

◆ key_to_nr()

int key_to_nr ( int  key)

Returns corresponding number for key code key.

Returns
0-9 if key corresponds to KEY_0 .. KEY_9 (respectively) or -1 if key isn't a number key

◆ sys_last_key()

int sys_last_key ( )

Returns currently pressed key code.

Returns
Currently pressed key code or 0 if no key is pressed

◆ wait_for_key_press()

void wait_for_key_press ( )

Wait for key press.

First waits for key release, then for key press and release.

Function also exits if the key isn't pressed after AUTO_OFF_MENU timeout.

◆ wait_for_key_release()

void wait_for_key_release ( int  tout)

Wait for key release or timeout.

Parameters
tout[1/100s] Timeout or 0 to wait until key is released.