Xors3d Engine
Keyboard

Functions

BBDECL void BBCALL xFlushKeys ()
 Flushes all the currently queued keystrokes.
BBDECL int BBCALL xGetKey ()
 This command will check to see if a key has been pressed and will return its ASCII value.
BBDECL int BBCALL xKeyDown (int key)
 Checks if specified key is pressed.
BBDECL int BBCALL xKeyHit (int key)
 Returns the number of times a specified key has been hit since the last time you called the xKeyHit() command.
BBDECL int BBCALL xKeyUp (int key)
 Checks if specified key was released.
BBDECL void BBCALL xWaitKey ()
 Stops programm until any key is pressed.

Function Documentation

BBDECL void BBCALL xFlushKeys ( )

Flushes all the currently queued keystrokes.

This command 'resets' or 'empties out' the queue holding the keyboard inputs

BBDECL int BBCALL xKeyHit ( int  key)

Returns the number of times a specified key has been hit since the last time you called the xKeyHit() command.

Parameters:
keyCorresponding key scancode
BBDECL int BBCALL xKeyUp ( int  key)

Checks if specified key was released.

This command returns 1 after each release of the key which was pressed before.

Parameters:
keyCorresponding key scancode
BBDECL void BBCALL xWaitKey ( )

Stops programm until any key is pressed.

This command makes your program halt until a key is pressed on the keyboard. Used alone, it simply halts and waits for a key press.

BBDECL int BBCALL xKeyDown ( int  key)

Checks if specified key is pressed.

This command (similar to its counterparts xMouseDown() and xJoyDown()) is used to detect if a key is being held down. This command returns a 0 if the key is not held down, a 1 if the key is held down.

Parameters:
keyCorresponding key scancode
BBDECL int BBCALL xGetKey ( )

This command will check to see if a key has been pressed and will return its ASCII value.