Help on module brlapi:
NAME
brlapi - This module is a binding for BrlAPI, a BrlTTY bridge for applications.
FILE
/usr/lib/python2.4/site-packages/brlapi.so
DESCRIPTION
C API documentation : http://mielke.cc/brltty/doc/BrlAPIref-HTML
Example :
import brlapi
b = brlapi.Connection()
b.enterTtyMode()
b.writeText("Press any key to continue ...")
key = b.readKey()
(command, argument, flags) = b.expandKeyCode(key)
b.writeText("Key %ld (%x %x %x) ! Press any key to exit ..." % (key, command, argument, flags))
b.readKey()
b.leaveTtyMode()
CLASSES
builtin.object
Connection
Write
ConnectionError
OperationError
class Connection(builtin.object)
| Class which manages the bridge between BrlTTY and your program
|
| Methods defined here:
|
| del(...)
| Close the BrlAPI conection
|
| init(...)
| x.init(...) initializes x; see x.class.doc for signature
|
| acceptKeyRange(...)
| Accept some key presses from the braille keyboard.
|
| This function asks the server to return keys between x and y to the application, and not give them to brltty.
|
| Note: You shouldn't ask the server to give you key presses which are usually used to switch between TTYs, unless you really know what you are doing ! The given codes are either raw keycodes if some driver name was given to enterTtyMode(), or brltty commands if None or "" was given.
|
| enterRawMode(...)
| Switch to Raw mode
|
| * driver : Specifies the name of the driver for which the raw communication will be established
|
| enterTtyMode(...)
| Ask for some tty, with some key mechanism
| * tty : If tty >= 0, application takes control of the specified tty
| If tty == -1, the library first tries to get the tty number from the WINDOWID environment variable (form xterm case), then the CONTROLVT variable, and at last reads /proc/self/stat (on linux)
| * how : Tells how the application wants readKey() to return key presses. None or "" means BrlTTY commands are required, whereas a driver name means that raw key codes returned by this driver are expected.
|
| expandKeyCode(...)
| Expand a keycode into command, argument and flags parts.
|
| ignoreKeyRange(...)
| Ignore some key presses from the braille keyboard.
|
| This function asks the server to give keys between x and y to brltty, rather than returning them to the application via readKey().
|
| Note: The given codes are either raw keycodes if some driver name was given to enterTtyMode(), or brltty commands if None or "" was given.
|
| leaveTtyMode(...)
| Stop controlling the tty
|
| readKey(...)
| Read a key from the braille keyboard.
|
| This function returns one key press's code.
|
| If None or "" was given to enterTtyPath(), a brltty command is returned. It is hence pretty driver-independent, and should be used by default when no other option is possible.
|
| By default, all commands but those which restart drivers and switch virtual are returned to the application and not to brltty. If the application doesn't want to see some command events, it should call either ignoreKeySet() or ignoreKeyRange().
|
| If some driver name was given to enterTtyMode(), a raw keycode is returned, as specified by the terminal driver. It generally corresponds to the very code that the terminal tells to the driver. This should only be used by applications which are dedicated to a particular braille terminal. Hence, checking the terminal type thanks to a call to driverid or even drivername before getting tty control is a pretty good idea.
|
| By default, all the keypresses will be passed to the client, none will go through brltty, so the application will have to handle console switching itself for instance.
|
| setFocus(...)
| Tell the current tty to brltty.
| This is intended for focus tellers, such as brltty, xbrlapi, screen, ... enterTtyMode() must have been called before hand to tell where this focus applies in the tty tree.
|
| write(...)
| Update a specific region of the braille display and apply and/or masks.
| * s : gives information necessary for the update
|
| writeDots(...)
| Write the given dots array to the display.
| * dots : points on an array of dot information, one per character. Its size must hence be the same as what displaysize provides.
|
| writeText(...)
| Write the given
|
|
| Data and other attributes defined here:
|
| new = <built-in method new of type object>
| T.new(S, ...) -> a new object with type S, a subtype of T
|
| auth = <attribute 'auth' of 'brlapi.Connection' objects>
| This tells where the BrlAPI server resides : it might be listening on another computer, on any TCP port. It should look like "foo:1", which means TCP port number BRLAPI_SOCKETPORTNUM+1 on computer called "foo".
|
| displaysize = <attribute 'displaysize' of 'brlapi.Connection' objects>
| Get the size of the braille display
|
| driverid = <attribute 'driverid' of 'brlapi.Connection' objects>
| Identify the driver used by BrlTTY
|
| drivername = <attribute 'drivername' of 'brlapi.Connection' objects>
| Get the complete name of the driver used by BrlTTY
|
| fileDescriptor = <attribute 'fileDescriptor' of 'brlapi.Connection' ob...
| Returns the Unix file descriptor that the connection uses
|
| host = <attribute 'host' of 'brlapi.Connection' objects>
| To get authorized to connect, libbrlapi has to tell the BrlAPI server a secret key, for security reasons. This is the path to the file which holds it; it will hence have to be readable by the application.
class ConnectionError
| Error while connecting to BrlTTY
|
| Methods defined here:
|
| init(...)
|
| str(...)
class OperationError
| Error while getting an attribute
|
| Methods defined here:
|
| init(...)
|
| str(...)
class Write(builtin.object)
| Structure containing arguments to be given to Bridge.write()
|
| Data and other attributes defined here:
|
| new = <built-in method new of type object>
| T.new(S, ...) -> a new object with type S, a subtype of T
|
| attrAnd = <attribute 'attrAnd' of 'brlapi.Write' objects>
| And attributes; applied first
|
| attrOr = <attribute 'attrOr' of 'brlapi.Write' objects>
| Or attributes; applied after ANDing
|
| charset = <attribute 'charset' of 'brlapi.Write' objects>
| Character set of the text
|
| cursor = <attribute 'cursor' of 'brlapi.Write' objects>
| -1 == don't touch, 0 == turn off, 1 = 1st char of display, ...
|
| displayNumber = <attribute 'displayNumber' of 'brlapi.Write' objects>
| Display number -1 == unspecified
|
| regionBegin = <attribute 'regionBegin' of 'brlapi.Write' objects>
| Region of display to update, 1st character of display is 1
|
| regionSize = <attribute 'regionSize' of 'brlapi.Write' objects>
| Number of characters held in text, attrAnd and attrOr. For multibytes text, this is the number of multibyte characters. Combining and double-width characters count for 1
|
| text = <attribute 'text' of 'brlapi.Write' objects>
| Text to display
DATA
BRL_DOT1 = 1
BRL_DOT2 = 2
BRL_DOT3 = 4
BRL_DOT4 = 8
BRL_DOT5 = 16
BRL_DOT6 = 32
BRL_DOT7 = 64
BRL_DOT8 = 128
KEY_CMD_ATTRBLINK = 536870956
KEY_CMD_ATTRDN = 536870920
KEY_CMD_ATTRUP = 536870919
KEY_CMD_ATTRVIS = 536870955
KEY_CMD_AUTOREPEAT = 536870959
KEY_CMD_AUTOSPEAK = 536870960
KEY_CMD_BACK = 536870942
KEY_CMD_BOT = 536870922
KEY_CMD_BOT_LEFT = 536870924
KEY_CMD_CAPBLINK = 536870957
KEY_CMD_CHRLT = 536870931
KEY_CMD_CHRRT = 536870932
KEY_CMD_CSRBLINK = 536870954
KEY_CMD_CSRHIDE = 536870951
KEY_CMD_CSRJMP_VERT = 536870984
KEY_CMD_CSRSIZE = 536870953
KEY_CMD_CSRTRK = 536870952
KEY_CMD_CSRVIS = 536870950
KEY_CMD_CUTAPPEND = 537067520
KEY_CMD_CUTBEGIN = 537001984
KEY_CMD_CUTLINE = 537198592
KEY_CMD_CUTRECT = 537133056
KEY_CMD_DESCCHAR = 537460736
KEY_CMD_DISPMD = 536870945
KEY_CMD_FREEZE = 536870944
KEY_CMD_FWINLT = 536870935
KEY_CMD_FWINLTSKIP = 536870937
KEY_CMD_FWINRT = 536870936
KEY_CMD_FWINRTSKIP = 536870938
KEY_CMD_GOTOLINE = 537722880
KEY_CMD_GOTOMARK = 537657344
KEY_CMD_HELP = 536870961
KEY_CMD_HOME = 536870941
KEY_CMD_HWINLT = 536870933
KEY_CMD_HWINRT = 536870934
KEY_CMD_INFO = 536870962
KEY_CMD_LEARN = 536870963
KEY_CMD_LNBEG = 536870939
KEY_CMD_LNDN = 536870914
KEY_CMD_LNEND = 536870940
KEY_CMD_LNUP = 536870913
KEY_CMD_MENU_FIRST_ITEM = 536870967
KEY_CMD_MENU_LAST_ITEM = 536870968
KEY_CMD_MENU_NEXT_ITEM = 536870970
KEY_CMD_MENU_NEXT_SETTING = 536870972
KEY_CMD_MENU_PREV_ITEM = 536870969
KEY_CMD_MENU_PREV_SETTING = 536870971
KEY_CMD_MUTE = 536870973
KEY_CMD_NOOP = 536870912
KEY_CMD_NXDIFCHAR = 537853952
KEY_CMD_NXDIFLN = 536870918
KEY_CMD_NXINDENT = 537395200
KEY_CMD_NXPGRPH = 536870926
KEY_CMD_NXPROMPT = 536870928
KEY_CMD_NXSEARCH = 536870930
KEY_CMD_PASSAT2 = 539164672
KEY_CMD_PASSDOTS = 539099136
KEY_CMD_PASTE = 536870985
KEY_CMD_PRDIFCHAR = 537788416
KEY_CMD_PRDIFLN = 536870917
KEY_CMD_PREFLOAD = 536870966
KEY_CMD_PREFMENU = 536870964
KEY_CMD_PREFSAVE = 536870965
KEY_CMD_PRINDENT = 537329664
KEY_CMD_PRPGRPH = 536870925
KEY_CMD_PRPROMPT = 536870927
KEY_CMD_PRSEARCH = 536870929
KEY_CMD_RESTARTBRL = 536870986
KEY_CMD_RESTARTSPEECH = 536870987
KEY_CMD_RETURN = 536870943
KEY_CMD_ROUTE = 536936448
KEY_CMD_SAY_ABOVE = 536870976
KEY_CMD_SAY_BELOW = 536870977
KEY_CMD_SAY_FASTER = 536870979
KEY_CMD_SAY_LINE = 536870975
KEY_CMD_SAY_LOUDER = 536870981
KEY_CMD_SAY_SLOWER = 536870978
KEY_CMD_SAY_SOFTER = 536870980
KEY_CMD_SETLEFT = 537526272
KEY_CMD_SETMARK = 537591808
KEY_CMD_SIXDOTS = 536870946
KEY_CMD_SKPBLNKWINS = 536870949
KEY_CMD_SKPIDLNS = 536870948
KEY_CMD_SLIDEWIN = 536870947
KEY_CMD_SPKHOME = 536870974
KEY_CMD_SWITCHVT = 537264128
KEY_CMD_SWITCHVT_NEXT = 536870983
KEY_CMD_SWITCHVT_PREV = 536870982
KEY_CMD_TOP = 536870921
KEY_CMD_TOP_LEFT = 536870923
KEY_CMD_TUNES = 536870958
KEY_CMD_WINDN = 536870916
KEY_CMD_WINUP = 536870915
KEY_FLG_AT2_EXTENDED = 512
KEY_FLG_AT2_KEYCODE = 1024
KEY_FLG_AT2_RELEASE = 256
KEY_FLG_CONTROL = 4
KEY_FLG_LINE_SCALED = 256
KEY_FLG_LINE_TOLEFT = 512
KEY_FLG_META = 8
KEY_FLG_REPEAT_DELAY = 16384
KEY_FLG_REPEAT_INITIAL = 32768
KEY_FLG_REPEAT_MASK = 49152
KEY_FLG_ROUTE = 1024
KEY_FLG_SHIFT = 1
KEY_FLG_TOGGLE_MASK = 768
KEY_FLG_TOGGLE_OFF = 512
KEY_FLG_TOGGLE_ON = 256
KEY_FLG_UPPER = 2
KEY_SYM_BACKSPACE = 65288
KEY_SYM_DELETE = 65535
KEY_SYM_DOWN = 65364
KEY_SYM_END = 65367
KEY_SYM_ESCAPE = 65307
KEY_SYM_F1 = 65470
KEY_SYM_F10 = 65479
KEY_SYM_F11 = 65480
KEY_SYM_F12 = 65481
KEY_SYM_F13 = 65482
KEY_SYM_F14 = 65483
KEY_SYM_F15 = 65484
KEY_SYM_F16 = 65485
KEY_SYM_F17 = 65486
KEY_SYM_F18 = 65487
KEY_SYM_F19 = 65488
KEY_SYM_F2 = 65471
KEY_SYM_F20 = 65489
KEY_SYM_F21 = 65490
KEY_SYM_F22 = 65491
KEY_SYM_F23 = 65492
KEY_SYM_F24 = 65493
KEY_SYM_F25 = 65494
KEY_SYM_F26 = 65495
KEY_SYM_F27 = 65496
KEY_SYM_F28 = 65497
KEY_SYM_F29 = 65498
KEY_SYM_F3 = 65472
KEY_SYM_F30 = 65499
KEY_SYM_F31 = 65500
KEY_SYM_F32 = 65501
KEY_SYM_F33 = 65502
KEY_SYM_F34 = 65503
KEY_SYM_F35 = 65504
KEY_SYM_F4 = 65473
KEY_SYM_F5 = 65474
KEY_SYM_F6 = 65475
KEY_SYM_F7 = 65476
KEY_SYM_F8 = 65477
KEY_SYM_F9 = 65478
KEY_SYM_HOME = 65360
KEY_SYM_INSERT = 65379
KEY_SYM_LEFT = 65361
KEY_SYM_LINEFEED = 65293
KEY_SYM_PAGE_DOWN = 65366
KEY_SYM_PAGE_UP = 65365
KEY_SYM_RIGHT = 65363
KEY_SYM_TAB = 65289
KEY_SYM_UC = 16777216
KEY_SYM_UP = 65362
KEY_TYPE_CMD = 536870912
KEY_TYPE_SYM = 0