BrlAPI 0.8
|
How to take control of ttys for direct braille display / read. More...
Macros | |
#define | BRLAPI_TTY_DEFAULT -1 |
Functions | |
int BRLAPI_STDCALL | brlapi_enterTtyMode (int tty, const char *driver) |
int BRLAPI_STDCALL | brlapi__enterTtyMode (brlapi_handle_t *handle, int tty, const char *driver) |
int BRLAPI_STDCALL | brlapi_enterTtyModeWithPath (const int *ttys, int count, const char *driver) |
int BRLAPI_STDCALL | brlapi__enterTtyModeWithPath (brlapi_handle_t *handle, const int *ttys, int count, const char *driver) |
int BRLAPI_STDCALL | brlapi_leaveTtyMode (void) |
int BRLAPI_STDCALL | brlapi__leaveTtyMode (brlapi_handle_t *handle) |
int BRLAPI_STDCALL | brlapi_setFocus (int tty) |
int BRLAPI_STDCALL | brlapi__setFocus (brlapi_handle_t *handle, int tty) |
Before being able to write on the braille display, the application must tell the server which tty it will handle.
The application must also specify how braille keys will be delivered to it. Two ways are possible:
#define BRLAPI_TTY_DEFAULT -1 |
Select the default tty.
The library takes the following steps:
WINDOWID
environment variable (for the xterm
case).CONTROLVT
environment variable./proc/self/stat
(on Linux
).int BRLAPI_STDCALL brlapi__enterTtyMode | ( | brlapi_handle_t * | handle, |
int | tty, | ||
const char * | driver | ||
) |
int BRLAPI_STDCALL brlapi__enterTtyModeWithPath | ( | brlapi_handle_t * | handle, |
const int * | ttys, | ||
int | count, | ||
const char * | driver | ||
) |
int BRLAPI_STDCALL brlapi__leaveTtyMode | ( | brlapi_handle_t * | handle | ) |
int BRLAPI_STDCALL brlapi__setFocus | ( | brlapi_handle_t * | handle, |
int | tty | ||
) |
int BRLAPI_STDCALL brlapi_enterTtyMode | ( | int | tty, |
const char * | driver | ||
) |
Ask for some tty, with some key mechanism
tty |
|
driver | tells how the application wants brlapi_readKey() to return key presses. NULL or "" means BRLTTY commands are required, whereas a driver name means that driver-specific keycodes are expected. |
WINDOWPATH and WINDOWID should be propagated when running remote applications via ssh, for instance, along with BRLAPI_HOST and the authorization key (see SendEnv in ssh_config(5) and AcceptEnv in sshd_config(5))
Once brlapi_enterTtyMode() is called, brlapi_leaveTtyMode() has to be called before calling brlapi_enterTtyMode() again.
TODO: document which functions work in TTY mode only.
int BRLAPI_STDCALL brlapi_enterTtyModeWithPath | ( | const int * | ttys, |
int | count, | ||
const char * | driver | ||
) |
Ask for some tty specified by its path in the tty tree, with some key mechanism
ttys | points on the array of ttys representing the tty path to be got. Can be NULL if nttys is 0. |
count | gives the number of elements in ttys. |
driver | has the same meaning as in brlapi_enterTtyMode() |
Providing nttys == 0 means to get the root, which is usually what a screen readers wants to use.
The content of WINDOWPATH or XDG_VTNR will always be prepended to the given ttys
array, so the application does not need to determine by itself where it is running.
int BRLAPI_STDCALL brlapi_leaveTtyMode | ( | void | ) |
int BRLAPI_STDCALL brlapi_setFocus | ( | int | tty | ) |
Tell the current tty to brltty
This is intended for focus tellers, such as brltty, xbrlapi, screen, ... brlapi_enterTtyMode() must have been called beforehand to tell where this focus applies in the tty tree.