brlapi_tty(3)
π brlapi_tty π
okay bestie, this is brlapi_tty β a Library Functions Manual page from the BrlAPI girlies. it's all about Entering & leaving tty mode, aka How to take control of ttys for direct braille display / read. π
β¨ NAME β¨
brlapi_tty β entering & leaving tty mode, fr fr
- how to take control of ttys so you can do direct braille display / read π
πΈ SYNOPSIS πΈ
π§ 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)
π Detailed Description π
okay so before your app can write literally anything on the braille display, it has to tell the server which tty it's gonna handle. no tty, no vibes. π
and it also has to say how braille keys are gonna be delivered to it. two ways are possible, and yes you must pick:
- driver-specific keycodes: the app gets values that are specific to each braille driver, since the keycode, as defined in the driver, will be given for each key event (press or release). using these leads to building highly driver-dependent applications β which honestly can still sometimes be useful, like when you wanna mimic existing proprietary applications for instance. it's giving "i cloned it, don't ask questions" π
- commands: the app gets exactly the same values as
brltty. this is the one that allows driver-independent clients, which will hopefully be nice to use with a lot of different terminals. main character energy, honestly. β¨
See also
brlapi_readKey()
π Macro Definition Documentation π
#define BRLAPI_TTY_DEFAULT -1
Select the default tty. lowkey the little "you know where i am" button π«Ά
the library takes these steps, in this order:
- Try to get the tty number from the
WINDOWIDenvironment variable (for the xterm case). - Try to get the tty number from the
CONTROLVTenvironment variable. - Read
/proc/self/stat(on Linux).
See also
brlapi_enterTtyMode()
π Function Documentation π
int BRLAPI_STDCALL brlapi__enterTtyMode (brlapi_handle_t * handle, int tty, const char * driver)
References BRLAPI_STDCALL.
int BRLAPI_STDCALL brlapi__enterTtyModeWithPath (brlapi_handle_t * handle, const int * ttys, int count, const char * driver)
References BRLAPI_STDCALL.
int BRLAPI_STDCALL brlapi__leaveTtyMode (brlapi_handle_t * handle)
References BRLAPI_STDCALL.
int BRLAPI_STDCALL brlapi__setFocus (brlapi_handle_t * handle, int tty)
References BRLAPI_STDCALL.
int BRLAPI_STDCALL brlapi_enterTtyMode (int tty, const char * driver)
Ask for some tty, with some key mechanism. bestie this is the door you knock on. πͺβ¨
Parameters
tty
- If
tty>=0then take control of the specified tty. - If
tty==BRLAPI_TTY_DEFAULTthen take control of the default 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. pick your fighter. π
Returns
the used tty number on success, -1 on error
ok listen.WINDOWPATHandWINDOWIDshould be propagated when running remote applications viassh, for instance, along withBRLAPI_HOSTand the authorization key (seeSendEnvinssh_config(5)andAcceptEnvinsshd_config(5)). don't forget them, that's the whole bit. π
and also β oncebrlapi_enterTtyMode()is called,brlapi_leaveTtyMode()has to be called before callingbrlapi_enterTtyMode()again. no skipping, no double-dipping, periodt. π€
if the application does not want to take control of a particular tty, but wants to keep control on all ttys, brlapi_enterTtyModeWithPath should be called instead with nttys equal to 0. this is usually what a screen reader wants to use. π
TODO: document which functions work in TTY mode only. (not me leaving a TODO in the docs, iconic honestly π« )
See also
brlapi_leaveTtyMode() brlapi_readKey()
References BRLAPI_STDCALL.
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. yes it's the tty tree, we're doing genealogy now π³
Parameters
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. the library already did the detective work for you, you're welcome π΅οΈβοΈ
Returns
0 on success, -1 on error.
See also
brlapi_enterTtyMode()
References BRLAPI_STDCALL.
int BRLAPI_STDCALL brlapi_leaveTtyMode (void )
Stop controlling the tty. the goodbye, the outro, the curtain call. π¬
Returns
0 on success, -1 on error.
See also
brlapi_enterTtyMode()
References BRLAPI_STDCALL.
int BRLAPI_STDCALL brlapi_setFocus (int tty)
Tell the current tty to brltty. π£
This is intended for focus tellers, such as brltty, xbrlapi, screen, ... (yes, the three dots are in the original, i'm not making things up π)
brlapi_enterTtyMode() must have been called beforehand to tell where this focus applies in the tty tree. no shortcuts, bestie, the tree needs its context π²
Returns
0 on success, -1 on error.
See also
brlapi_enterTtyMode() brlapi_leaveTtyMode()
References BRLAPI_STDCALL.
π Author π
Generated automatically by Doxygen for BrlAPI from the source code. (so if the prose is a little stiff, blame the robot, not me π«Ά)
and that's the whole page, bestie!! πβ¨ generated by BrlAPI, Version 0.8 β go forth and take control of your ttys, you gorgeous driver-independent icon πππ¦
π¦ where this page comes from
- fedora 43: brlapi-devel 0.8.7-4.fc43 Β· LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later
- fedora 43: brlapi-devel 0.8.7-4.fc43 Β· LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later
- fedora 44: brlapi-devel 0.8.7-8.fc44 Β· LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later
- fedora 44: brlapi-devel 0.8.7-8.fc44 Β· LGPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-or-later
- opensuse-leap 16.0: brlapi-devel 6.8-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: brlapi-devel 6.8-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: brlapi-devel 6.8-160000.2.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: brlapi-devel 6.8-160000.2.2 Β· LGPL-2.1-or-later
- ubuntu stonking: libbrlapi-dev 6.9.1+repack-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms