.\" Use -ms .\" $XConsortium: a2x.ms,v 1.50 94/10/30 21:54:56 rws Exp $ .de Ds .RS .nf .sp .5 .. .de De .fi .sp .5 .RE .. .EH ''Using a2x'' .OH ''Using a2x'' .EF ''\fB % \fP'' .OF ''\fB % \fP'' .ps 10 .nr PS 10 \& .sp 10 .ce 1 \s+2\fBUsing a2x\fP\s-2 .sp 10 .ce 2 Bob Scheifler X Consortium .ps 9 .nr PS 9 .sp 10 .LP .nf DragonDictate is a trademark of Dragon Systems, Inc. X Window System is a trademark of X Consortium, Inc. DESQview/X is a trademark of Quarterdeck Office Systems .fi .ps 10 .nr PS 10 .bp 1 .NH 1 Getting Started .LP \fBa2x\fP is designed to interface DragonDictate to the X Window System. \fBa2x\fP converts the ASCII output of DragonDictate into X device events. \fBa2x\fP is capable of manipulating both the keyboard and the pointer; depending on the applications, it is possible to use X hands-free through \fBa2x\fP. .LP \fBa2x\fP requires an X protocol extension to function. The XTEST, DEC-XTRAP, and XTestExtension1 extensions can be used. The XTEST extension was developed by the X Consortium for use in the X Test Suite, and an R5 patch to support the XTEST extension is available via anonymous ftp to ftp.x.org, as the file /pub/XTEST/R5fix-xtest-1. The DEC-XTRAP extension was developed by Digital Equipment Corp., and public versions are available for both R4 and R5. The XTestExtension1 extension was originally developed for an old test suite done by an informal group known as the X Testing Consortium; the client-side library and some device-independent code exists in both the R4 and R5 core distributions, but only a couple sample servers (HP and X386) in the X Consortium distribution supports the extension (some product servers might though). .LP \fBa2x\fP was originally written for the XTEST extension, but both DEC-XTRAP and XTestExtension1 should also work. The main difference as far as \fBa2x\fP is concerned is that XTEST permits time delays inside the X server, while with DEC-XTRAP and XTestExtension1 the delays are handled on the client side and hence can be somewhat less accurate, but time delays are rarely needed. In addition, XTestExtension1 does not provide a way to synthesize relative pointer motion, so the WarpPointer protocol request is used instead. .LP The Imakefile for \fBa2x\fP comes configured to use only XTEST, but you can configure it to compile in support for any or all of the extensions; \fBa2x\fP will automatically choose whichever extension is supported by the display. If you dynamically switch among different displays supporting different extensions, you will probably want to compile more than one extension into \fBa2x\fP. At the top of the Imakefile are #define's for BuildWithXTest, BuildWithXTrap, and BuildWithXTestExt1; simply set the ones you want to YES and the ones you don't want to NO. To see which extensions are supported by your X server, use \fBxdpyinfo\fP. Your server must have at least one of "XTEST", "DEC-XTRAP", or "XTestExtension1" in order to use \fBa2x\fP. .LP The Imakefile also comes configured by default to assume that DragonDictate version 1.01 is being used, although the actual version can be overridden on the \fBa2x\fP command line. If you normally use DragonDictate 1.01a or 2.0, then change the #define for OldDragonDictate to NO before building. .LP The documentation provided here is for using DragonDictate and \fBa2x\fP solely for work under X; the assumption is that you do not use DragonDictate with programs on the PC. If you use DragonDictate with programs on the PC, you may need to create dcom files for switching between PC and X use. .LP A mailing list of \fBa2x\fP users exists, to keep people abreast of any new developments. The mailing list is a2x-users@x.org; send requests to join to a2x-users-request@x.org. .LP There are two ways to run DragonDictate: directly under DOS, and under DESQview/X. Running directly under DOS is described here; running under DESQview/X is described later. .LP The normal mode of operation is to use a telnet program on the PC, and telnet across to your workstation and log in. You may wish to try using rsh instead of telnet, but the performance may be substantially worse. If you do not have a network connection, it should be possible to use a terminal program and log in to the workstation over a serial line, but performance over a serial line will likely not be as good as over a network. In the telnet session, run the script \fBDragonDictate\fP provided with the \fBa2x\fP distribution. You should be able to speak this, by saying "DragonDictate", "[enter\ key]", "OK" (the "OK" being necessary to pop down the menu to permit execution to continue). This script simply clears the screen and starts up \fBa2x\fP. Clearing the screen is a convenience so that the focus of attention on the PC screen will be the DragonDictate menus. You can, of course, write your own script or simply run \fBa2x\fP directly. .LP You will probably find it convenient to force the DragonDictate menus to appear in a fixed position on the PC screen. For example, in the "Parameters" menu from "Voice Console", set .Ds .TA 1.5i .ta 1.5i pop-up-row 0 pop-up-col 24 .De .LP You should also set .Ds .TA 1.5i .ta 1.5i pop-up-delay 0 compatibility-delay 0 .De for quickest operation. .LP \fBa2x\fP takes each ASCII character produced by DragonDictate and determines a key on the X keyboard that can be pressed and released to generate that character. If Shift and Control modifiers are necessary to generate the character, \fBa2x\fP will automatically press and release keys for those modifiers. For example, for the character 'A', \fBa2x\fP will typically have to press a Shift modifier key, press an 'a' key, release the 'a' key, and then release the Shift modifier key. .LP It is not necessary to perform all of your "typing" through \fBa2x\fP; you can mix \fBa2x\fP output with direct keyboard typing and direct pointer manipulation. But, you should normally only switch between direct input and \fBa2x\fP input when all keys and buttons are in the released state, to avoid confusing \fBa2x\fP. (One simple exception to this rule is that you can use \fBa2x\fP to press/release buttons and keys while directly moving the pointer with your hand.) .LP This document uses the notation {c\-\fI\fP} to represent a control character, the character you get by holding down the Ctrl (Control) key and typing the character \fI\fP. For example, {c\-t} represents what you get by holding Ctrl and typing 't'. This syntax is the same as what you will see in DragonDictate 1.01 menus if you enter control characters into macros. In DragonDictate 2.0, the syntax has changed to {Ctrl+\fI\fP}, so keep this difference in mind so that you don't get confused. .LP \fBa2x\fP interprets the character {c\-t} specially; it introduces a control sequence for special \fBa2x\fP operations. The character {c\-t} was chosen because it occurs infrequently in normal text; escape was not chosen because you might use it frequently in voice macros to send escape sequences to applications. There are two types of \fBa2x\fP control sequences: {c\-t} followed by a single control character, and {c\-t} followed by a string of characters terminated by another {c\-t}. Control sequences are described in detail below. .LP \fBa2x\fP also interprets the backspace character ({c\-h} or {Backspace}) specially. When you make corrections through DragonDictate, e.g., you use "choose \fI\fP", DragonDictate will output backspaces to "undo" the previous choice before outputting the characters for the new choice (if any). For many X users, it is more convenient to receive Delete (Rubout) characters instead of backspaces. The default action of \fBa2x\fP is to convert Backspace to Delete; if you do not want this behavior, specify "-b" on the \fBa2x\fP command line. .LP \fBa2x\fP also interprets backspace characters specially in that it assumes they are produced by DragonDictate to make corrections and are not produced as normal text (i.e., that voice macros do not contain backspace characters). \fBa2x\fP looks at backspace characters in order to undo edits (described in more detail below). As such, it is recommended that you change some predefined DragonDictate voice macros to replace backspace characters with delete characters or with control sequences to generate backspace. For example, you should modify the keystrokes of the built-in commands "[backspace]", "[back\ 1]", "[back\ 2]", "[back\ 3]", "[back\ 4]", and "[back\ 5]", replacing each "{Backspace}" with "{Del}" to generate delete instead of backspace. If you really want to generate backspace, then replace each "{Backspace}" with the sequence "{c\-t}{c\-c}h" instead. .LP If you are using a terminal program over a serial line, make sure your program is not automatically converting backspace to delete, as this will cause \fBa2x\fP's undo mechanism to not work. .NH 1 Keyboard Control .LP To "type" a non-ASCII key on the keyboard, use the following control sequence: .Ds {c-t}\fI\fP{c-t} .De where \fI\fP is the string name of a keysym. \fBa2x\fP will find a key on the keyboard labeled with this keysym, and press and release that key. For example: .Ds add-word /t "[doit]" "{c-t}Execute{c-t}" invisible .De defines a voice macro to press and release a key labeled with the "Execute" keysym. If for some reason your Xlib does not know the string name of the keysym you want, you can specify the hexadecimal value of the keysym instead. For example: .Ds add-word /t "[doit]" "{c-t}FF62{c-t}" invisible .De would also specify the Execute keysym. .LP When the specified key is a modifier key, the key is pressed but is not released until after the next nonmodifier key (or button) is pressed. This is called "sticky" modifiers. For example: .Ds add-word /t "[meta key]" "{c-t}Meta_L{c-t}" left right .De would set the Meta modifier if a key labeled with Meta_L is attached to a modifier. So, you could say "[meta\ key]" "x" to generate meta-x. However, since there are both Meta_L and Meta_R keysyms, and since Meta is commonly used, there is a special control sequence for this: .Ds {c-t}{c-m} .De So, more commonly you would specify: .Ds add-word /t "[meta key]" "{c-t}{c-m}" left right add-word /t "[meta x]" "{c-t}{c-m}x" left right .De .LP Similarly, there is a special control sequence for the Shift modifier: .Ds {c-t}{c-s} .De and a special control sequence for the Control modifier: .Ds {c-t}{c-c} .De .LP The Shift control sequence is not normally needed in conjunction with character keys, but is useful with function keys. For example: .Ds add-word /t "[dismiss window]" "{c-t}{c-c}{c-t}{c-s}{c-t}{c-m}{c-t}F3{c-t}" invisible .De generates control-shift-meta-F3, which might, e.g., be bound in a .twmrc as: .Ds "F3" = c|s|m : window : f.delete .De .LP The Control sequence would not normally be needed in conjunction with character keys, since DragonDictate can output control characters, but the edit mechanism DragonDictate uses has problems with control characters. Specifically, when DragonDictate generates backspaces as a result of "choose\ \fI\fP" or "[scratch\ that]", it will not generate backspaces for control characters. This is a problem, because it prevents \fBa2x\fP from properly undoing control characters. For example, if you defined: .Ds add-word /t "[move right]" "{c-f}" invisible .De in order to use emacs-style positioning control, then \fBa2x\fP would be unable to provide the undo help of generating {c\-b} to compensate when DragonDictate mistakenly matched this voice command, because DragonDictate would not output any backspaces. Instead, you should define: .Ds add-word /t "[move right]" "{c-t}{c-c}f" invisible .De .LP This way, DragonDictate will output a backspace for correction, and \fBa2x\fP will recognize that a control sequence is attached to the 'f' character and treat the sequence as a single entity for undo purposes. Of course, if no undo action is desired for control characters, you can represent them directly. For example: .Ds add-word /t "[move end]" "{c-e}" invisible .De is reasonable for emacs-style positioning control because there is normally no way to return to the original position. You also don't need to expand control characters if there are noncontrol characters in the sequence. For example: .Ds add-word /t "[split window]" "{c-x}2" invisible .De .LP DragonDictate will output a backspace for the '2', so the {c\-x} does not need to be expanded to "{c\-t}{c\-c}x" (although it doesn't hurt). .NH 1 Autorepeat .LP It is convenient at times to be able to autorepeat a keystroke, e.g., when using incremental search in \fBemacs\fP or when paging through a document. To autorepeat the last keystroke generated by \fBa2x\fP, use the control sequence: .Ds {c-t}{c-a}\fI\fP 0 0{c-t} .De where \fI\fP is a floating point number specifying the rate in seconds. For example: .Ds add-word /t "[autorepeat it]" "{c-t}{c-a}1.5 0 0{c-t}" invisible .De will autorepeat every 1.5 seconds. So, you might have defined: .Ds add-word /t "[search for]" "{c-s}" left right .De for incremental search in \fBemacs\fP. You can say "[search\ for]" to start a search, say what you are searching for, say "[search\ for]" again, and then say "[autorepeat\ it]" to autorepeat the search. .LP When autorepeat is in progress, it continues until you explicitly stop it or until the next keystroke is generated through \fBa2x\fP. You can explicitly stop autorepeat with the control sequence: .Ds {c-t}{c-q} .De .LP For example: .Ds add-word /t "[stop moving]" "{c-t}{c-q}" invisible .De .LP The autorepeat control sequence also controls pointer motion; the two zeros given in the keyboard autorepeat sequence can be replaced with other values, as described further below. .NH 1 Button Control .LP To toggle the state of a button, use the control sequence: .Ds {c-t}{c-b}\fI