Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ hilkbd(7) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

termio(7)

hil(7)

mknod(1M)

select(2)

signal(2)

HILKBD(7)  —  Series 800 Only

NAME

hilkbd − HP-HIL mapped keyboard driver

DESCRIPTION

HP-HIL, the Hewlett-Packard Human Interface Link, is the Hewlett-Packard standard for interfacing  a personal computer, terminal, or workstation to its input devices.  Hilkbd supplies input from all mapped keyboards on a specified HP-HIL link. 

Hilkbd returns mapped keycodes, not ASCII characters.  "Raw" keycodes are the individual key downstrokes and upstrokes, and are different for each type of keyboard.  Hilkbd maps the raw input into the keycodes and protocol expected by the HP-UX, PWS, and RMB operating systems.  The hil(7) driver can usurp a keyboard from hilkbd by changing it from mapped mode to raw mode. 

System Calls

Open(2) gives exclusive access to the keyboard.  If there is an ITE (internal terminal emulator) associated with the keyboard, the ITE will lose input from the keyboard until the keyboard device is closed. Any previous queued input for the keyboard device is flushed from the input queue.

Close(2) will return control of the keyboard to the ITE, if present. Any unread input at that time will be discarded.

Read(2) returns data from the keyboard in time-stamped packets:

unsigned char time_stamp[4];
unsigned char status;
unsigned char data;

The time_stamp, when repacked into an integer data type of four or more bytes, specifies the time since an arbitrary point in the past (e.g., system start-up time).  This point does not change between packets, but time during a power failure may or may not be counted.  The time is in units of tens of milliseconds. 

The status byte encodes the state of the keyboard shift and ctrl keys:

0x8X shift and control
0x9X control only
0xAX shift only
0xBX no shift or control

The data byte contains the actual keystroke. 

If the file status flag O_NDELAY is set, read(2) will return 0 instead of blocking, when no data is available.  The read(2) system call on an HP-HIL keyboard is considered "slow"; that is, it may be interrupted by caught signals (see signal(2)).

Write(2) is not supported by hilkbd. 

Select(2) can be used to poll for input to read from hilkbd devices.  Select(2) for write or for exceptional conditions will always return a false indication in the bit masks.

Ioctl(2) is used to perform special operations on the device.  The ioctl(2) system calls have the form:

int ioctl(fildes, request, arg)
int fildes, request;
char *arg;

The following hilkbd request codes are defined in <sys/hilioctl.h>:

KBD_READ_CONFIG
Read the configuration code.

This command returns in the char variable to which arg points a one-byte configuration code.  This contains a field, defined by KBD_IDCODE_MASK, which specifies the keyboard identification code.  The possible values of this field are defined in the header file, and this identification code affects interpretation of the language code.  All other fields in the configuration code are currently undefined. 

KBD_READ_LANGUAGE
Read the language code.

This command returns in the char variable to which arg points a one-byte language code, as read from the keyboard.  If there is more than one keyboard, the language is taken from the first keyboard on the link.  Interpretation of the language code is affected by the keyboard identification field within the configuration code. 

KBD_STATUSRead the keyboard status register. 

This command returns in the char variable to which arg points a one-byte value containing bit flags specifying the state of the shift and control keys:

KBD_STAT_LEFTSHIFT The left shift key is up.
KBD_STAT_RIGHTSHIFT The right shift key is up.
KBD_STAT_SHIFT Both shift keys are up.
KBD_STAT_CTRL The control key is up.

Other bits are undefined. 

KBD_REPEAT_RATE
Set the keyboard auto-repeat rate.

The one-byte value to which arg points is the negative of the repeat period, in tens of milliseconds.  The repeat rate is the reciprocal of the repeat period.  A parameter of zero disables auto-repeat. 

KBD_REPEAT_DELAY
Set the keyboard auto-repeat delay.

The one-byte value to which arg points is the negative of the repeat delay, in tens of milliseconds. 

KBD_BEEPCause an audible beep. 

The one-byte value to which arg points specifies the volume of the beep, within the range 0 to KBD_MAXVOLUME.  Implementations with fewer than KBD_MAXVOLUME discrete levels of volume will scale the parameter into the smaller range. 

ERRORS

[EINVAL] An invalid parameter was detected by ioctl(2).

[EINTR] A signal was caught during a read(2) system call.

[ENXIO] No keyboard is present on the HP-HIL link specified by the minor number. 

[ENODEV] An attempt was made to use write(2) using hilkbd. 

[EBUSY] The device is already open. 

AUTHOR

Hilkbd was developed by the Hewlett-Packard Company. 

FILES

/dev/hilkbd*

SEE ALSO

termio(7), hil(7), mknod(1M), select(2), signal(2). 

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026