1Entering & leaving tty mode(3)      BrlAPI      Entering & leaving tty mode(3)
2
3
4

NAME

6       Entering & leaving tty mode - How to take control of ttys for direct
7       braille display / read.
8
9
10   Defines
11       #define BRLAPI_TTY_DEFAULT   -1
12
13   Functions
14       int BRLAPI_STDCALL brlapi_enterTtyMode (int tty, const char *driver)
15       int BRLAPI_STDCALL brlapi__enterTtyMode (brlapi_handle_t *handle, int
16           tty, const char *driver)
17       int BRLAPI_STDCALL brlapi_enterTtyModeWithPath (int *ttys, int count,
18           const char *driver)
19       int BRLAPI_STDCALL brlapi__enterTtyModeWithPath (brlapi_handle_t
20           *handle, int *ttys, int count, const char *driver)
21       int BRLAPI_STDCALL brlapi_leaveTtyMode (void)
22       int BRLAPI_STDCALL brlapi__leaveTtyMode (brlapi_handle_t *handle)
23       int BRLAPI_STDCALL brlapi_setFocus (int tty)
24       int BRLAPI_STDCALL brlapi__setFocus (brlapi_handle_t *handle, int tty)
25

Detailed Description

27       Before being able to write on the braille display, the application must
28       tell the server which tty it will handle.
29
30       The application must also specify how braille keys will be delivered to
31       it. Two ways are possible: key codes and commands:
32
33       · key codes are specific to each braille driver, since the raw key
34         code, as defined in the driver will be given for each key press.
35         Using them leads to building highly driver-dependent applications,
36         which can yet sometimes be useful to mimic existing proprietary
37         applications for instance.
38
39       · commands means that applications will get exactly the same values as
40         brltty. This allows driver-independent clients, which will hopefully
41         be nice to use with a lot of different terminals.
42
43       See also:
44           brlapi_readKey()
45

Define Documentation

47   #define BRLAPI_TTY_DEFAULT   -1
48       Select the default tty.
49
50       The library takes the following steps:
51
52       1.  Try to get the tty number from the WINDOWID environment variable
53           (for the xterm case).
54
55       2.  Try to get the tty number from the CONTROLVT environment variable.
56
57       3.  Read /proc/self/stat (on Linux).
58
59       See also:
60           brlapi_enterTtyMode()
61

Function Documentation

63   int BRLAPI_STDCALL brlapi__enterTtyMode (brlapi_handle_t * handle, int tty,
64       const char * driver)
65   int BRLAPI_STDCALL brlapi__enterTtyModeWithPath (brlapi_handle_t * handle,
66       int * ttys, int count, const char * driver)
67   int BRLAPI_STDCALL brlapi__leaveTtyMode (brlapi_handle_t * handle)
68   int BRLAPI_STDCALL brlapi__setFocus (brlapi_handle_t * handle, int tty)
69   int BRLAPI_STDCALL brlapi_enterTtyMode (int tty, const char * driver)
70       Ask for some tty, with some key mechanism
71
72       Parameters:
73           tty
74
75           · If tty>=0 then take control of the specified tty.
76
77           · If tty==BRLAPI_TTY_DEFAULT then take control of the default tty.
78
79           driver tells how the application wants brlapi_readKey() to return
80           key presses. NULL or '' means BRLTTY commands are required, whereas
81           a driver name means that raw key codes returned by this driver are
82           expected.
83
84       WINDOWPATH and WINDOWID should be propagated when running remote
85       applications via ssh, for instance, along with BRLAPI_HOST and the
86       authorization key (see SendEnv in ssh_config(5) and AcceptEnv in
87       sshd_config(5))
88
89       Returns:
90           the used tty number on success, -1 on error
91
92       See also:
93           brlapi_leaveTtyMode() brlapi_readKey()
94
95   int BRLAPI_STDCALL brlapi_enterTtyModeWithPath (int * ttys, int count,
96       const char * driver)
97       Ask for some tty specified by its path in the tty tree, with some key
98       mechanism
99
100       Parameters:
101           ttys points on the array of ttys representing the tty path to be
102           got. Can be NULL if nttys is 0.
103           count gives the number of elements in ttys.
104           driver has the same meaning as in brlapi_enterTtyMode()
105
106       Providing nttys == 0 means to get the root.
107
108       See also:
109           brlapi_enterTtyMode()
110
111   int BRLAPI_STDCALL brlapi_leaveTtyMode (void)
112       Stop controlling the tty
113
114       Returns:
115           0 on success, -1 on error.
116
117       See also:
118           brlapi_enterTtyMode()
119
120   int BRLAPI_STDCALL brlapi_setFocus (int tty)
121       Tell the current tty to brltty
122
123       This is intended for focus tellers, such as brltty, xbrlapi, screen,
124       ... brlapi_enterTtyMode() must have been called beforehand to tell
125       where this focus applies in the tty tree.
126
127       Returns:
128           0 on success, -1 on error.
129
130       See also:
131           brlapi_enterTtyMode() brlapi_leaveTtyMode()
132
133Version 1.0                       7 Oct 2009    Entering & leaving tty mode(3)
Impressum