Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ keyboard(7) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gpxconfig(1)

xset(1)

console(7)

display(7)

gpx(7)

termio(7)

keyboard(7)

NAME

keyboard − graphics keyboard

DESCRIPTION

A fully-configured graphics display station consists of a display, a keyboard, and a mouse.  Each of these components operates as a separate device.  The keyboard device is described here; the other components are described elsewhere (see console(7), display(7), and termio(7)). 

The keyboard associated with a GPX display station can be connected to either of the two UART ports of the processor board to which the monitor is connected.  The display monitor is actually connected to the Integrated SCSI/Ethernet/Graphics (ISEG) daughter-board, and which of the two tty ports is associated with the display is selected by setting a DIP switch on the ISEG daughter-board.  The tty association can also be set by the gpxconfig(1) command. 

The keyboard uses the regular device special file names for terminals connected at those ports, /dev/console, /dev/remote, or /dev/remoten. 

When the keyboard device associated with a GPX graphics display is opened, it operates in a translation mode in which all codes generated by the keyboard are converted to ISO 8859/1 characters (as superset of the ASCII character set).  The translation mode may be changed by the application so that the up/down key codes of the keyboard are received when the application reads from that device.  The open also disables CTS flow control for output to the keyboard. 

Most of the ioctl(2) commands that are applicable to asynchronous serial terminals are accepted by stand-alone keyboards (see termio(7)).  The following commands are unique to keyboards:

KBTRANS Set the translation mode.  The argument is an integer with the value KBD_ASCII to enable translation of up/down codes to the 8859/1 code set, or KBD_UPDOWN to disable that translation and pass through the up/down codes themselves.  The return value is the previous translation mode. 

KBSLED Set the keyboard LEDs.  The argument is an integer which contains a bitwise or of the following constants:

LED_NUM_LOCK
LED_CAPS_LOCK
LED_SCROLL_LOCK

KBBELL Sound an audible bell, if supported.  The argument must be zero.  The return value is zero if the bell sound was produced, or −1 with errno set to ­EINVAL if the keyboard is not equipped with a bell. 

KBCLICK Enable or disable an audible key click.  The argument is an integer with the value KBD_CLICK to enable an audible click, or KBD_NOCLICK to disable the click. 

KBREPEAT Select the key repeat frequency and delay time.  The argument is a pointer to an integer containing the frequency and delay information.  The value of bits 5 and 6 control the delay time ranging from approximately 250ms (0 value) to 1 second (3).  The value of bits 0 to 4 control the repeat frequency ranging from 30Hz (0) to 2Hz (31). 

KBRESET Reset the keyboard to its initial state.  The argument must be zero.  The key click, repeat frequency and delay, and LEDs are affected. 

KBWRITE Send a character to the keyboard (i.e., not the separate graphics output device that might be associated with the keyboard).  The argument is a pointer to a character which will be sent to the keyboard port. 

All ioctl command and parameter symbols are defined in <sys/ioctl.h>.  In KBD_ASCII translation mode, the codes generated by each key are modified by the Shift, Control, Alt, Caps Lock, and Num Lock keys. 

Shift When the Shift key is held down concurrently with an alphabetic key, the key’s upper-case code is generated.  Otherwise, the lower-case code is generated.  For example, the G key generates the code for “g”, hexadecimal value 0x67, whereas SHIFT-G (the “Shift” and “G” keys pressed concurrently) generates the code for “G”, hexadecimal value 0x47. 

  Keys that have two symbols on the keycap have the lower symbol transmitted when the Shift key is not held down, and the upper symbol transmitted when the key is held down. 

Control The Control key causes the high 3 bits of the 8-bit character code to be zeroed.  For example, CTRL-G generates the hexadecimal code value 0x07 (0x67 & 0x1F), not the code for “g”. 

Alt The Alt key causes the high bit of the character code to be set.  For example, ALT-G generates the hexadecimal code value 0xE7 (0x67 | 0x80). 

Caps Lock The Caps Lock key is a toggle key.  Pressing it once enables Caps Lock mode, pressing it again disables that mode.  Caps Lock mode has the effect of the Shift key on alphabetic keys.  It has no effect on other keys. 

Num Lock The Num Lock key is a toggle key.  Pressing it once enables Num Lock mode, pressing it again disables that mode.  Num Lock mode only affects the keys on the numeric keypad.  It has the effect of the Shift key on those keys, in that the code for the upper symbol is transmitted. 

The modifiers are applied in the order Caps Lock and Num Lock, Shift, Control, and Alt.  Therefore, ALT-SHIFT-G (three keys pressed concurrently) generates the hexadecimal code value 0xC7. 

Besides the alphabetic, punctuation, and ASCII control characters, the keyboard provides several special function keys.  The codes generated by these keys are shown in the table below:

Key Unshifted Shifted
Esc ESC ESC
Backspace BS DEL
Tab HT ESC [ Z
Enter CR CR
Insert ESC [ 2 ~ ESC [ L
Delete ESC [ 3 ~ ESC [ M
Home ESC [ H ESC [ 7 ~
End ESC [ 8 ~ ESC [ 9 ~
Page Up ESC [ 5 ~ ESC [ V
Page Down ESC [ 6 ~ ESC [ U
Up Arrow ESC [ A ESC [ A
Down Arrow ESC [ B ESC [ B
Left Arrow ESC [ D ESC [ D
Right Arrow    ESC [ C ESC [ C
PrtSc/SysRq ESC [ i ESC [ 2 5 ~
F1 ESC [ 2 0 1 ~ ESC [ 2 1 3 ~
. . . . . . . . .
F12 ESC [ 2 1 2 ~ ESC [ 2 2 4 ~

The Alt key has no effect on keys that generate multi-character sequences.

The Scroll Lock, Pause, and Break keys have no effect. 

FILES

/dev/console
/dev/remote
/dev/remoten
/dev/gpxn
<sys/ioctl.h>

SEE ALSO

gpxconfig(1) in the CX/UX User’s Reference Manual . 

xmodmap, xset(1),

console(7), display(7), gpx(7), termio(7). 

NOTES

The KBCLICK and KBBELL commands are ineffective and will return −1 and errno set to EINVAL. 

CX/UX Administrator’s Reference

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