brlapi_keys(3) | BrlAPI | brlapi_keys(3) |
brlapi_keys - How to read key presses from the braille terminal.
struct brlapi_expandedKeyCode_t
struct brlapi_describedKeyCode_t
struct brlapi_range_t
#define brlapi_ignoreAllKeys()
brlapi_ignoreKeys(brlapi_rangeType_all, NULL, 0)
#define brlapi_acceptAllKeys()
brlapi_acceptKeys(brlapi_rangeType_all, NULL, 0)
#define BRLAPI_UC_ROW 0x2800UL
#define brlapi__ignoreAllKeys(handle) brlapi__ignoreKeys(handle,
brlapi_rangeType_all, NULL, 0)
#define brlapi__acceptAllKeys(handle) brlapi__acceptKeys(handle,
brlapi_rangeType_all, NULL, 0)
enum brlapi_rangeType_t { brlapi_rangeType_all,
brlapi_rangeType_type, brlapi_rangeType_command,
brlapi_rangeType_key, brlapi_rangeType_code }
int BRLAPI_STDCALL brlapi_expandKeyCode
(brlapi_keyCode_t code, brlapi_expandedKeyCode_t *expansion)
int BRLAPI_STDCALL brlapi_describeKeyCode
(brlapi_keyCode_t code, brlapi_describedKeyCode_t
*description)
int BRLAPI_STDCALL brlapi_readKey (int wait,
brlapi_keyCode_t *code)
int BRLAPI_STDCALL brlapi__readKey (brlapi_handle_t
*handle, int wait, brlapi_keyCode_t *code)
int BRLAPI_STDCALL brlapi_ignoreKeys (brlapi_rangeType_t
type, const brlapi_keyCode_t keys[], unsigned int count)
int BRLAPI_STDCALL brlapi__ignoreKeys (brlapi_handle_t
*handle, brlapi_rangeType_t type, const brlapi_keyCode_t
keys[], unsigned int count)
int BRLAPI_STDCALL brlapi_acceptKeys (brlapi_rangeType_t
type, const brlapi_keyCode_t keys[], unsigned int count)
int BRLAPI_STDCALL brlapi__acceptKeys (brlapi_handle_t
*handle, brlapi_rangeType_t type, const brlapi_keyCode_t
keys[], unsigned int count)
int BRLAPI_STDCALL brlapi__ignoreAllKeys (brlapi_handle_t
*handle)
int BRLAPI_STDCALL brlapi__acceptAllKeys (brlapi_handle_t
*handle)
int BRLAPI_STDCALL brlapi_ignoreKeyRanges (const
brlapi_range_t ranges[], unsigned int count)
int BRLAPI_STDCALL brlapi__ignoreKeyRanges
(brlapi_handle_t *handle, const brlapi_range_t ranges[],
unsigned int count)
int BRLAPI_STDCALL brlapi_acceptKeyRanges (const
brlapi_range_t ranges[], unsigned int count)
int BRLAPI_STDCALL brlapi__acceptKeyRanges
(brlapi_handle_t *handle, const brlapi_range_t ranges[],
unsigned int count)
Once brlapi_enterTtyMode() has been called, the application can call brlapi_readKey() to read key presses. Either key codes (see Types and Defines fore BrlAPI Key Codes) or commands will be returned, depending on parameters given to brlapi_enterTtyMode().
Key presses are buffered, so that calling brlapi_readKey() in non-blocking mode from time to time should suffice.
Accept all key presses from the braille keyboard
This function asks the server to give all keys to the application, and not give them to brltty.
Warning: after calling this function, make sure to call brlapi_ignoreKeys() for ignoring important keys like BRL_CMD_SWITCHVT_PREV/NEXT and such.
Ignore all key presses from the braille keyboard
This function asks the server to give all keys to brltty, rather than returning them to the application via brlapi_readKey().
Unicode braille row
types of key ranges
Enumerator
Accept some key presses from the braille keyboard
This function asks the server to return the provided key ranges (inclusive) to the application, and not give them to brltty.
Parameters:
Note:
Accept some key presses from the braille keyboard
This function asks the server to give the provided keys to the application, and not give them to brltty.
Parameters:
Note:
Describe the components of a key code.
Parameters:
Returns:
Expand the components of a key code
Parameters:
Returns:
Ignore some key presses from the braille keyboard
This function asks the server to give the provided key ranges to brltty, rather than returning them to the application via brlapi_readKey().
Parameters:
Note:
Ignore some key presses from the braille keyboard
This function asks the server to give the provided keys to brltty, rather than returning them to the application via brlapi_readKey().
Parameters:
Note:
Read a key from the braille keyboard
This function returns one key press's code.
If NULL or '' was given to brlapi_enterTtyMode(), a brltty command is returned, as described in the documentation for brlapi_keyCode_t . It is hence pretty driver-independent, and should be used by default when no other option is possible.
By default, all commands but those which restart drivers and switch virtual terminals are returned to the application and not to brltty. If the application doesn't want to see some command events, it should call brlapi_ignoreKeys()
If some driver name was given to brlapi_enterTtyMode(), a raw keycode is returned, as specified by the terminal driver, usually in <brltty/brldefs-xy> where xy is the driver's code. It generally corresponds to the very code that the terminal tells to the driver. This should only be used by applications which are dedicated to a particular braille terminal. Hence, checking the terminal type thanks to a call to brlapi_getDriverName() before getting tty control is a pretty good idea.
By default, all the keypresses will be passed to the client, none will go through brltty, so the application will have to handle console switching itself for instance.
Parameters:
Returns:
Programming hints:
If your application is only driven by braille command keypresses, you can just call brlapi_readKey(1, &code) so that it keeps blocking, waiting for keypresses.
Else, you'll probably want to use the file descriptor returned by brlapi_openConnection() in your 'big polling loop'. For instance:
and then, when you detect inbound trafic on the file descriptor, do something like this:
while (brlapi_readKey(0, &code) { // process keycode code // ... }
The while loop is needed for processing all pending key presses, else some of them may be left in libbrlapi's internal key buffer and you wouldn't get them immediately.
Note:
Generated automatically by Doxygen for BrlAPI from the source code.
Sun Feb 03 2019 | Version 0.6 |