|
|
Using the X Window System > Chapter 3 Preliminary ConfigurationUsing Special Input Devices |
|
Input devices are connected to Hewlett-Packard computers through several different hardware interfaces. Among the interfaces supported are the Hewlett-Packard Human Interface Link (HP-HIL) and the industry standard RS-232C (serial) and DIN interfaces. Some Hewlett-Packard computers do not support all of these interfaces. The X server can access input devices through any of the above interfaces. Devices that use the HP-HIL interface and devices that use the DIN interface and that are compatible with the HP DIN keyboard and mouse can be used by simply plugging them into the computer. Devices that use the RS-232C interface require the installation of input device driver software before they can be used. If no explicit input device configuration is done, the X server chooses the X keyboard device and X pointer device from the input devices that are connected to the computer (in most cases, the keyboard and a mouse). On computers that support both HP-HIL and DIN interfaces, the DIN input devices are used if both types of devices are connected. HP-HIL input devices can plug into other HP-HIL devices, with up to seven input devices connected together. If there are no DIN input devices connected, and there are multile HP-HIL input devices, the following algorithm is used to choose an X keyboard and pointer device.
The X server reads an input device file, X0devices in /etc/X11, to find out what input devices it should open and attach to the display.
The default X0devices file contains lines of text, but does not specify any input configuration. Rather, it assumes the default input configuration of one keyboard and one pointer. If this is your configuration, you may not want to change the contents of the file for three reasons:
A custom X*devices file is required only when you want to tell the X server about a custom input device configuration. The X server can be explicitly configured to use a specific input device as the X pointer or X keyboard, or merge the data from an input device with that from the X pointer or keyboard. This configuration is done by adding information to the X*devices file. There is one syntax to use for HP-HIL devices, and another syntax for devices that require a device driver to be loaded by the X server (such as RS-232 devices). HP-HIL devices can be specified in either of two ways:
Some RS-232C input devices can be used with the X server. A device driver must exist for the desired serial input device, and it must reside in the /usr/lib/X11/extensions directory. Input device drivers are usually supplied by the input device vendor along with the input device. Sample input device drivers and documentation describing how to write an input device driver may be found in the /usr/contrib/X11drivers/input directory. To use an RS-232 input device, you must modify the X*devices file to inform the X server which input device driver is to be loaded, the serial port to which it is connected, and how it is to be used. This is done by adding an entry to the X*devices file of the following form:
where:
The following example specifies a Spatial System Spaceball ® connected to the serial port associated with device file /dev/tty00 as the X pointer:
More examples of input device specifications for RS-232 input devices are in the /usr/newconfig/etc/X11/X0devices file. The device can be specified using its device type and position by adding an entry to the X*devices file with the following form:
where:
Valid positions, types, and uses are in “Selecting Values for `X*devices' Files”, along with examples. Separate the parts of your entry with tabs or spaces. The position of an input device on the HP-HIL is relative to other devices of the same type. For example if you have two keyboards, a graphics tablet, and a mouse connected, they are referred to as "first keyboard", "second keyboard", "first tablet", and "first mouse". This syntax is useful for computers on which a single X server is running, and on which no other programs directly access input devices. With this syntax, if you add a new input device to the HP-HIL, you don't have to edit the X*devices file unless the device is of the same type as one already named in the file and you add the device ahead of the existing device. This syntax should not be used if more than one X server will be run on the same computer, or if non-X programs will be directly accessing input devices. The X server interprets "first" to mean "first accessible", so you may not always get the first on the HP-HIL, just the first one not already in use. X*devices files use the following special names for positions, devices, and uses: Table 3-3 Values for `X*devices' Files.
* The nine-knob box appears to the X server as three separate input devices. Each row of knobs is a separate device with the first device being the bottom row. ** Note also that the HP barcode reader has two modes: keyboard and ASCII. The modes are set via switches on the reader. If you set the barcode reader to ASCII transmission mode, it appears to the server as a barcode reader and the device name is therefore barcode. However, if you set the barcode reader to emulate a keyboard, the barcode reader appears as a keyboard and the device name should therefore be keyboard. What distinguishes a barcode reader set to keyboard mode from a real keyboard is the relative position or the device file name, depending on which syntax you use. *** Similar to the barcode reader, the trackball appears to the server, not as a trackball, but as a mouse. Therefore, to specify a trackball, use the mouse device name. Again, what specifies the trackball instead of the real mouse is the relative position or the device filename, depending on which syntax you use. You can create a system on which the X server runs, but which does not have any input devices. In this case, clients could be run from a remote terminal, or from a remote host, and their output directed to the X server. To create a system with no input, include the following lines in the X0devices file:
If you had a more complicated configuration, such as two graphics tablets, two keyboards, and a barcode reader, your X*devices file could look like this:
In this example, the first tablet acts as the pointer, the second keyboard acts as the keyboard, input from the second tablet is treated as if it came from the X pointer, and input from the first keyboard and the barcode reader is treated as if it came from the X keyboard. Note that the barcode reader is in ASCII mode in this example. If the barcode reader were in keyboard mode, the last line of the example would read as follows:
More examples can be found in the X0devices file in /usr/newconfig/etc/X11. The device can be specified using the name of the device to which it is attached. This can be done by adding an entry to the X*devices file with the form:
where:
This syntax should be used if more than one X server will be running on the computer, or if non-X programs will be accessing the input devices. It refers to a specific position on the HP-HIL. The X*devices file can be used to redefine the path searched for HP-HIL devices. By default, the path searched is /dev/hil. The device files are named by appending the numbers "1" through "7" to the path. The path is redefined by adding an entry to the X*devices file with the following form:
where:
The X server appends the numbers "1" through "7" to the specified path. For example, specifying:
results in the device names /tmp/foo1, /tmp/foo2, and so on. |
|