Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Graphics Administration Guide: HP 9000 Workstations and Servers > Chapter 6 X Windows Configuration Details

Using Special Input Devices

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

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.

How the X Server Chooses the Default Keyboard and Pointer

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 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.

  1. If no explicit specification is made through the X*devices file, the last mouse (the one farthest from the computer on the HP-HIL line) is used as the X pointer and the last keyboard is used as the X keyboard.

  2. If no mouse is available, the last pointing device (such as a dial box, graphics tablet, or trackball) is used as the X pointer. If no keyboard is available, the last key device (such as a buttonbox or barcode reader) is used as the X keyboard.

  3. If either the pointer or keyboard are unavailable, the X server won't run unless explicitly configured to run with no input devices.

X*devices File

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.

NOTE: A sample X0devices file is loaded into /etc/X11 unless one already exists. In that case, it is in /usr/newconfig/etc/X11.

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 these reasons:

  • Clients can request and receive the services of an input device regardless of whether the device is specified in a device configuration file. Thus, you need not change the X0devices file, or create a custom file, even though you have a custom input configuration.

  • Even if you have other screen configurations, you can rely on the default input device configuration without having to create an X*devices file to match every X*screens file. For example, if you had a custom X*screens file, you would not necessarily need an X*devices file.

A custom X*devices file is required only when you want to tell the X server about a custom input device configuration.

Explicitly Specifying Input Device Use

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:

  • Device type and position.

  • Device file name.

Explicitly Specifying RS-232 Input Device Use

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:

Begin_Device_Description Namedevice_driver_namePathdevice_file_pathUse device_useEnd_Device_Description

where:

Title not available (Explicitly Specifying RS-232 Input Device Use )

device_driver_name

Specifies the name of the input device driver shared library.

device_file_path

Specifies the name of the device file for the serial port being used.

device_use

Specifies the desired use of the input device, such as "keyboard", "pointer", "other", or "extension".

The following example specifies a Spatial System Spaceball® connected to the serial port associated with device file /dev/tty00 as the X pointer:

Begin_Device_Description
Name spaceball.sl
Path /dev/tty00
Use pointer
End_Device_Description

More examples of input device specifications for RS-232 input devices are in the /usr/newconfig/etc/X11/X0devices file.

Specifying HP-HIL Input Device Use by Device Type and Position

The device can be specified using its device type and position by adding an entry to the X*devices file with the following form:

relative_position〉 〈device_type〉 〈use#comments

where:

Title not available (Specifying HP-HIL Input Device Use by Device Type and Position )

relative_position

Specifies the position of the device on the HP-HIL relative to the other devices on the HP-HIL, for example, "first", "second", and so on.

device_type

Specifies the type of input device, such as "keyboard", "mouse", or "tablet".

use

Is "keyboard", "mouse", or "other".

#comments

Describes device. Comments are optional, but if present, must start with a "#".

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.

Selecting Values for X*devices Files

X*devices files use the following special names for positions, devices, and uses:

Table 6-1 Values for X*devices Files

Positions

Device Type (Device Class)

Uses

first

keyboard (keyboard)

keyboard

second

mouse (pointer)

pointer

third

tablet (pointer)

other

fourth

buttonbox (keyboard)

fifth

barcode (keyboard)1

sixth

one_knob (pointer)

seventh

nine_knob (pointer)2

quadrature (pointer)

touchscreen (pointer)

trackball (pointer)3

null

 

  1. 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.

  2. The nine-knob box appears to the X server as three separate input devices. Each row of knobs is a separate device, and the first device is the bottom row.

  3. 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.

Examples

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:

first     null   keyboard
first null pointer

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:

  • first tablet pointer The pointer

  • second tablet other Merged with the pointer

  • first keyboard other Merged with the keyboard

  • second keyboard keyboard The keyboard

  • first barcode other Merged with the keyboard

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:

third   keyboard    other

More examples can be found in the X0devices file in /usr/newconfig/etc/X11.

Specifying HP-HIL Input Device Use by Device File Name

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:

/path/device_fileuse#comments

where:

Title not available (Specifying HP-HIL Input Device Use by Device File Name )

path/device_file

Specifies the name of the device file associated with the input device.

use

is "keyboard", "pointer", or "other".

#comments

Describes the device. Comments are optional, but if present, must be preceded by a "#".

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.

Redefining the HP-HIL Search Path

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:

path〉 〈hil_path#comment

where:

Title not available (Redefining the HP-HIL Search Path )

path

Specifies the path to be searched for the HP-HIL input devices.

#comments

Describes the path. Comments are optional, but if present, must be preceded by a "#".

The X server appends the numbers "1" through "7" to the specified path. For example, specifying:

/tmp/fred     hil_path

results in the device names /tmp/fred1, /tmp/fred2, and so on.

Stopping the X Window System

After stopping all application programs, stop the window system by holding down the Ctrl and left Shift keys, and then pressing the Reset key. This stops the display server, and with it the window system. (If you have a PC-style keyboard, press Shift Ctrl Pause instead.)

The sequence of keys that stops the display server can be customized in the X*pointerkeys file. Refer to the X0pointerkeys file in /etc/X11.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.