bx-lib : the Basic X11 Library tuned for C beginners
1.0
|
Functions | |
bx_key | bx_read_key (void) |
int | bx_keyname_pressed (bx_key key, char keyname[]) |
int | bx_keycode_pressed (bx_key key, unsigned char keycode) |
unsigned char | bx_keyname_to_keycode (char keyname[]) |
char * | bx_keycode_to_keyname (unsigned char keycode) |
char * | bx_keynames (bx_key key) |
int | bx_key_number (bx_key key) |
void | bx_set_autorepeat (int activate) |
int | bx_get_autorepeat (void) |
bx_key bx_read_key | ( | void | ) |
Takes an instantaneous snapshot of the current state of the whole keyboard, that is, the state pressed/released of all its keys.
int bx_keyname_pressed | ( | bx_key | key, |
char | keyname[] | ||
) |
Checks if a key known by its keyname is pressed in a given keyboard snapshot.
key | a snapshot of the keyboard returned by bx_read_key(). |
keyname | the name of a given key of the keyboard. |
int bx_keycode_pressed | ( | bx_key | key, |
unsigned char | keycode | ||
) |
Checks if a key known by its keycode is pressed in a given keyboard snapshot. The keycode is a number given to key depending on its physical location on the keyboard.
key | a snapshot of the keyboard returned by bx_read_key(). |
keycode | a keycode describing the physical location of a key. |
unsigned char bx_keyname_to_keycode | ( | char | keyname[] | ) |
Given a key named keyname, returns its keycode, that its physical location on the keyboard with respect to the installed key mapping (AZERTY, QWERTY, ...)
keyname | a name describing a key |
char* bx_keycode_to_keyname | ( | unsigned char | keycode | ) |
Given a physical location on the keyboard described by keycode, returns its keyname, that is, the attribution of this key with respect the installed key mapping (AZERTY, QWERTY, ...)
keycode | a keycode describing the physical location of a key. |
char* bx_keynames | ( | bx_key | key | ) |
Returns a string listing the names of all keys that are pressed in the given snapshot.
key | a snapshot of the keyboard returned by bx_read_key(). |
int bx_key_number | ( | bx_key | key | ) |
Gets the number of key that are pressed in a given keyboard snapshot.
key | a snapshot of the keyboard returned by bx_read_key(). |
void bx_set_autorepeat | ( | int | activate | ) |
Sets the autorepeat mode of the keyboard on or off. When on, if a key is kept physically pressed after a certain amount of time, the system cyclically reports "fake" couples of release/press states. In bx-lib, autorepeat is off by default, thaty is, bx-lib ignores the "fake" states reported by X11.
activate | sets autorepeat mode on (non zero) or off (zero). |
int bx_get_autorepeat | ( | void | ) |
Checks whether autorepeat mode for the keyboard is on or off.