1
.TH "Entering & leaving tty mode" 3 "15 May 2009" "Version 1.0" "BrlAPI" \" -*- nroff -*-
5
Entering & leaving tty mode \- How to take control of ttys for direct braille display / read.
12
.RI "#define \fBBRLAPI_TTY_DEFAULT\fP -1"
19
.RI "int BRLAPI_STDCALL \fBbrlapi_enterTtyMode\fP (int tty, const char *driver)"
22
.RI "int BRLAPI_STDCALL \fBbrlapi__enterTtyMode\fP (\fBbrlapi_handle_t\fP *handle, int tty, const char *driver)"
25
.RI "int BRLAPI_STDCALL \fBbrlapi_enterTtyModeWithPath\fP (int *ttys, int count, const char *driver)"
28
.RI "int BRLAPI_STDCALL \fBbrlapi__enterTtyModeWithPath\fP (\fBbrlapi_handle_t\fP *handle, int *ttys, int count, const char *driver)"
31
.RI "int BRLAPI_STDCALL \fBbrlapi_leaveTtyMode\fP (void)"
34
.RI "int BRLAPI_STDCALL \fBbrlapi__leaveTtyMode\fP (\fBbrlapi_handle_t\fP *handle)"
37
.RI "int BRLAPI_STDCALL \fBbrlapi_setFocus\fP (int tty)"
40
.RI "int BRLAPI_STDCALL \fBbrlapi__setFocus\fP (\fBbrlapi_handle_t\fP *handle, int tty)"
43
.SH "Detailed Description"
45
Before being able to write on the braille display, the application must tell the server which tty it will handle.
47
The application must also specify how braille keys will be delivered to it. Two ways are possible: key codes and commands:
50
key codes are specific to each braille driver, since the raw key code, as defined in the driver will be given for each key press. Using them leads to building highly driver-dependent applications, which can yet sometimes be useful to mimic existing proprietary applications for instance.
52
commands means that applications will get exactly the same values as \fIbrltty\fP. This allows driver-independent clients, which will hopefully be nice to use with a lot of different terminals.
56
\fBbrlapi_readKey()\fP
62
.SH "Define Documentation"
64
.SS "#define BRLAPI_TTY_DEFAULT -1"
66
Select the default tty.
68
The library takes the following steps:
70
Try to get the tty number from the \fCWINDOWID\fP environment variable (for the \fCxterm\fP case).
72
Try to get the tty number from the \fCCONTROLVT\fP environment variable.
74
Read \fC/proc/self/stat\fP (on \fCLinux\fP).
79
\fBbrlapi_enterTtyMode()\fP
83
.SH "Function Documentation"
85
.SS "int BRLAPI_STDCALL brlapi__enterTtyMode (\fBbrlapi_handle_t\fP * handle, int tty, const char * driver)"
87
.SS "int BRLAPI_STDCALL brlapi__enterTtyModeWithPath (\fBbrlapi_handle_t\fP * handle, int * ttys, int count, const char * driver)"
89
.SS "int BRLAPI_STDCALL brlapi__leaveTtyMode (\fBbrlapi_handle_t\fP * handle)"
91
.SS "int BRLAPI_STDCALL brlapi__setFocus (\fBbrlapi_handle_t\fP * handle, int tty)"
93
.SS "int BRLAPI_STDCALL brlapi_enterTtyMode (int tty, const char * driver)"
95
Ask for some tty, with some key mechanism
101
If tty>=0 then take control of the specified tty.
103
If tty==\fBBRLAPI_TTY_DEFAULT\fP then take control of the default tty.
106
\fIdriver\fP tells how the application wants \fBbrlapi_readKey()\fP to return key presses. NULL or '' means BRLTTY commands are required, whereas a driver name means that raw key codes returned by this driver are expected.
109
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))
113
the used tty number on success, -1 on error
118
\fBbrlapi_leaveTtyMode()\fP \fBbrlapi_readKey()\fP
122
.SS "int BRLAPI_STDCALL brlapi_enterTtyModeWithPath (int * ttys, int count, const char * driver)"
124
Ask for some tty specified by its path in the tty tree, with some key mechanism
128
\fIttys\fP points on the array of ttys representing the tty path to be got. Can be NULL if nttys is 0.
130
\fIcount\fP gives the number of elements in ttys.
132
\fIdriver\fP has the same meaning as in \fBbrlapi_enterTtyMode()\fP
135
Providing nttys == 0 means to get the root.
139
\fBbrlapi_enterTtyMode()\fP
143
.SS "int BRLAPI_STDCALL brlapi_leaveTtyMode (void)"
145
Stop controlling the tty
149
0 on success, -1 on error.
154
\fBbrlapi_enterTtyMode()\fP
158
.SS "int BRLAPI_STDCALL brlapi_setFocus (int tty)"
160
Tell the current tty to brltty
162
This is intended for focus tellers, such as brltty, xbrlapi, screen, ... \fBbrlapi_enterTtyMode()\fP must have been called beforehand to tell where this focus applies in the tty tree.
166
0 on success, -1 on error.
171
\fBbrlapi_enterTtyMode()\fP \fBbrlapi_leaveTtyMode()\fP