[BRLTTY] input events

Sébastien Hinderer Sebastien.Hinderer at ens-lyon.org
Sat Dec 2 18:16:53 EST 2006


Hi,

Scott Haeger :
> Right now brlapi gives key input events only during a key release.  Are 
> there any plans to support both a key press and a key release event.

BrlAPI blindly forwards the key codes it gets from a driver to the
appropriate client application (the one that has focus).
More precisely, key presses can (for now) be delivered to applications
in two different ways:

1. As BRLTTY commands codes. This is what happens by default and is
supported by any driver. Here indeed there is no notion of a key press
or release, a command being in general something abstract with a rather
logical meaning. (There is the exception of AT keycodes, though).

2. As driver-specific key codes. This possibility is not available for all
drivers. It is available only if the driver gets key events by (1)
reading key codes and (2) converting those codes into brltty commands.
To let BrlAPI take advantage of this, the driver must define both a
brl_readKey and a brl_keyToCommand function, brl_readCommand then being
the composition of those functions. The driver must also #define
BRL_HAVE_KEY_CODES before including brl_driver.h
To come back to the ruestion: if the driver defines key codes associated
to key presses and releases, then this is what client applications will
see when entering in tty mode with the driver's name as argument to
brlapi_enterTtyMode (this function was formerly called brlapi_getTty).

Hope these perhaps too technical explanations will help and not confuse.

Cheers,
Sébastien.


More information about the BRLTTY mailing list