|
|
1.1 ! root 1: .\"$Header: keyboard.4,v 10.1 86/11/19 10:56:03 jg Exp $ ! 2: .\"$Source: /u1/X/libibm/doc/man/RCS/keyboard.4,v $ ! 3: .\" This file uses -man macros. ! 4: .TH KEYBOARD 4 "31 Mar 1986" "Space overwritten by .AC macro" " " ! 5: .UC 4 ! 6: .AC 1 0 ! 7: .SH NAME ! 8: keyboard \- keyboard interface ! 9: .SH DESCRIPTION ! 10: .PP ! 11: The keyboard adapter returns scan codes that the keyboard driver translates ! 12: into ASCII characters. This translation is done through table lookup; ! 13: \fIpf\fR(i) allows users to change the translation tables ! 14: so as to redefine the ASCII characters generated by ! 15: particular keystrokes. ! 16: .PP ! 17: There are two sets of translation tables: a standard set ! 18: not normally changed (see \fIkeyboard_codes\fR(5)),, ! 19: and a working set the user may freely change ! 20: as desired (see \fIpf\fR(i)). ! 21: .PP ! 22: In addition to generating ASCII characters, the keyboard interface ! 23: can invoke special functions (swapping of key definitions, etc.; ! 24: see below). ! 25: Most of these special functions are bound to ! 26: the three keys labeled ! 27: \fB<Print-Screen/SysRq>\fR, \fB<Scroll-Lock>\fR, ! 28: and \fB<Pause/Break>\fR. ! 29: The normal use of these keys, together with the four shift or meta-keys, ! 30: give a total of 15 possible meta functions that can be invoked: ! 31: .nf ! 32: ! 33: .ft B ! 34: Key Normal Shift Ctrl Alt Action ! 35: .ft R ! 36: Print-Screen/ FN_PRINT FN_IGNORE FN_LOG FN_IGNORE FN_SET ! 37: SysRq ! 38: Scroll-Lock FN_SCROLL FN_SWAP FN_SWRESET FN_SWITCH FN_CLICK ! 39: ! 40: Pause/Break FN_DEBUG FN_DEBUG FN_IGNORE FN_KILL FN_RESET ! 41: ! 42: .fi ! 43: .SH "Keyboard META Functions" ! 44: .TP ! 45: FN_ACTION ! 46: (Usually bound to the ! 47: .B <Action> ! 48: key.) ! 49: Puts the keyboard into action mode. ! 50: Action mode selects the ``action'' set of key values. ! 51: .TP ! 52: FN_ALT ! 53: (Usually bound to ! 54: \fB<Alt>\fR.) ! 55: Puts the keyboard into alt mode. ! 56: Alt mode selects the ``alt'' set of key values. ! 57: .TP ! 58: FN_BREAK ! 59: Not usually specified by the user; it is invoked when a ! 60: ``make-break'' key is released by the user and should only be bound to ! 61: that single hardware code. ! 62: .TP ! 63: FN_CLICK ! 64: (Usually bound to ! 65: .BR <Action><Scroll/Lock> .) ! 66: Causes a different ``key click'' mode to be selected. There are four such ! 67: modes: no click, hardware click, software click, and both hardware ! 68: and software click. ! 69: .TP ! 70: FN_DEBUG ! 71: (Usually bound to the ! 72: .B <Pause/Break> ! 73: key.) ! 74: Invokes the debugger (see \fIdebug\fR(8)). ! 75: Once in console-debugger mode, a ``go'' command can be used to restart ! 76: the system. On systems without the debugger, the screen still displays ! 77: DEBUG in the status line; but the debugger will not be entered. ! 78: .br ! 79: A system-attention sequence ! 80: .RB ( "<Ctrl>-<Alt>-<SysRq>" ) ! 81: can also be used to enter the ! 82: debugger; use this only if the ! 83: FN-DEBUG function ! 84: does not work. ! 85: .TP ! 86: FN_IGNORE ! 87: (Usually bound to keys that neither generate characters nor ! 88: activate meta-functions.) Causes that key to be ignored. ! 89: .TP ! 90: FN_KILL ! 91: (Usually bound to ! 92: \fB<Alt><Pause/Break>\fR.) ! 93: Causes a HANGUP signal (see ! 94: .IR signal (2)) ! 95: to be sent to the processes currently in the console terminal process group. ! 96: It also marks the console terminal as closed. This is sufficient to stop most ! 97: programs that do not catch or ignore the HANGUP signal. This is analogous ! 98: to hanging up a dialup line to drop the connection. ! 99: If the ! 100: function is invoked again while the console terminal is marked as closed, it ! 101: generates a KILL signal to all processes ! 102: in the current process group. ! 103: .TP ! 104: FN_NUM_LOCK ! 105: (Usually bound to ! 106: \fB<Num-Lock>\fR.) ! 107: Puts the keyboard into num-lock mode. ! 108: .TP ! 109: FN_PRINT ! 110: (Usually bound to ! 111: \fB<Print-Screen>\fR.) ! 112: Causes the current console screen image to be sent to the line printer. ! 113: .TP ! 114: FN_LOG ! 115: (Usually bound to ! 116: \fB<Ctrl>-<Print-Screen>\fR.) ! 117: Turns hardcopy logging of the screen on and off. ! 118: Kernel/user hardcopy is independent of debugger hardcopy. ! 119: .TP ! 120: FN_RESET ! 121: (Usually bound to ! 122: \fB<Action><Pause-Break>\fR.) ! 123: Causes the keyboard definitions to be reset to their standard values. ! 124: This is also automatically done when the console terminal is closed, in order ! 125: to ensure that the next user to log in receives a normal keyboard. ! 126: .TP ! 127: FN_SWAP ! 128: (Usually bound to ! 129: \fB<Shift><Scroll-Lock>\fR.) ! 130: Exchanges the bindings of the next two keys typed. ! 131: This is particularly useful for swapping the definitions ! 132: of the ! 133: .B "<Caps-Lock>" ! 134: key and the ! 135: .B "<Ctrl>" ! 136: key. ! 137: .TP ! 138: FN_SHIFT ! 139: (Usually bound to the keys labeled ! 140: .B <Shift> ! 141: on either side of the keyboard.) ! 142: Puts the keyboard into shifted mode. ! 143: .TP ! 144: FN_SWITCH ! 145: (Usually bound to ! 146: \fB<Alt><Scroll-Lock>\fR.) ! 147: Causes the console output to be switched to the next available display ! 148: device (see \fIconsole\fR(4)). ! 149: .TP ! 150: FN_SWRESET ! 151: (Usually bound to ! 152: \fB<Ctrl><Scroll-Lock>\fR.) ! 153: Causes the console output to be switched to the next available display device, ! 154: and the display to be re-initialized. ! 155: If necessary, this involves loading ! 156: microcode; in all cases, the display is cleared and the cursor moved to the ! 157: top left corner. ! 158: .TP ! 159: FN_SCROLL ! 160: (Usually bound to ! 161: \fB<Scroll-Lock>\fR.) ! 162: Causes normal output to the console display to be locked out by generating ! 163: the current XOFF character (see \fItty\fR(4)). ! 164: Output stops, and the Scroll-Lock ! 165: light on the keyboard comes on. ! 166: When the Scroll-Lock light is on, pressing the ! 167: .B <Scroll Lock> ! 168: key again generates the current XON character, which ! 169: causes output to resume and the Scroll Lock to go off. ! 170: Note that if the console is in RAW mode, ! 171: the ! 172: .B <Scroll Lock> ! 173: key only generates XOFF characters. ! 174: .TP ! 175: FN_SET ! 176: (Usually bound to ! 177: \fB<Action><Print-Screen>\fR.) ! 178: Sets a new value into the keyboard translation table that determines ! 179: the ASCII characters generated for particular scan codes (see below). ! 180: .TP ! 181: FN_BEEP ! 182: (Not usually bound to a key.) ! 183: Sounds the bell (a beep) when invoked. ! 184: .TP ! 185: FN_CAPS_LOCK ! 186: (Usually bound to ! 187: \fB<Caps-Lock>\fR ! 188: or to ! 189: \fB<Ctrl>\fR.) ! 190: Causes the keyboard to go into Caps-Lock mode. The keyboard ! 191: leaves Caps-Lock mode when the FN_CAPS_LOCK function is ! 192: next generated or when the next FN_SHIFT is generated. This ! 193: behavior is similar to that of many typewriters. Caps-Lock mode ! 194: selects the ``Shift'' set of key values. ! 195: .TP ! 196: FN_CONTROL ! 197: (Usually bound to ! 198: \fB<Ctrl>\fR or to ! 199: \fB<Caps-Lock>fR.) ! 200: Causes the keyboard to go into Control mode. Control mode ! 201: selects the ``control'' set of key values. ! 202: .SH NOTES ! 203: .PP ! 204: When the keyboard has more than one mode in effect, the key value ! 205: selected is that of the highest priority mode. ! 206: The mode priority ordering is: normal, ! 207: shift, control, alt, and action (normal being low and action being high). ! 208: .PP ! 209: The keyboard adapter also supports the speaker, which is activated ! 210: when the ASCII character \fBbel\fP ! 211: .RB ( ^G ) ! 212: is sent to the display. ! 213: .PP ! 214: It is possible to change the association of keyboard functions and the ! 215: ASCII strings generated by the keyboard driver in two ways: from the ! 216: keyboard and from within a program. ! 217: It is convenient to have a set of definitions (or bindings) ! 218: done every time a user logs on the system; this is best ! 219: done via the ! 220: .IR pf (i) ! 221: utility invoked from one's ! 222: .I .login ! 223: file during login. If this utility is unavailable, or the user wishes ! 224: to redefine a key temporarily, it may be done from the keyboard. ! 225: The keyboard procedure is: ! 226: .IP 1. 5 ! 227: Invoke the FN_SET function (normally bound to ! 228: \fB<Action><Print-Screen>\fR). ! 229: This causes ! 230: .B "KEY?" ! 231: to be displayed in the status line. ! 232: .IP 2. 5 ! 233: Enter the keystroke for the key to be set (this includes using the ! 234: appropriate shift (or meta) key such as ! 235: \fB<Shift>\fR, \fB<Alt>\fR, \fB<Ctrl>\fR, or ! 236: \fB<Action>\fR). ! 237: The status line will show ! 238: .B DEF ! 239: when the keystroke has been accepted. ! 240: .IP 3. 5 ! 241: Enter the definition. It echoes on the status line as it is ! 242: accepted. Note that control keys are displayed as ^, followed by the ! 243: appropriate letter. ! 244: .IP 4. 5 ! 245: Enter the keystroke for the key being set (as for step 2). This completes ! 246: the definition. ! 247: .PP ! 248: If during definition you decide to cancel the definition being ! 249: entered, re-invoke the FN_SET function. ! 250: .PP ! 251: A few \fIioctl\fP(2) calls apply to the ! 252: \fIkeyboard\fR device, and have the form: ! 253: ! 254: .RS ! 255: .nf ! 256: .ft B ! 257: #include <machinecons/keyboard.h> ! 258: struct kbdarg { ! 259: char kbd_scan; /* scan code */ ! 260: char kbd_index; /* the position to change */ ! 261: char kbd_length; /* the length following */ ! 262: char kbd_text[KBD_STRING_LENGTH]; /* the text */ ! 263: char kbd_end; /* a nullend flag just in case */ ! 264: }; ! 265: ioctl(files, code, arg) ! 266: int *arg; ! 267: ! 268: \fRor:\fB ! 269: ! 270: struct kbdarg *arg; ! 271: ! 272: #define KBD_INDEX_NORMAL 0 /* normal position */ ! 273: #define KBD_INDEX_SHIFT 1 /* shifted */ ! 274: #define KBD_INDEX_CONTROL 2 /* control'ed */ ! 275: #define KBD_INDEX_ALT 3 /* alt'ed */ ! 276: #define KBD_INDEX_ACTION 4 /* action'ed */ ! 277: ! 278: #define CLICK_OFF 0x00 ! 279: #define CLICK_HARD 0x01 /* hardware click */ ! 280: #define CLICK_SOFT 0x02 /* software click */ ! 281: #define CLICK_BOTH 0x03 /* both */ ! 282: ! 283: #define KBDCGET _IOWR(k,0,struct kbdarg) /* get current def'n */ ! 284: #define KBDCSET _IOW(k,1,struct kbdarg) /* set new definition */ ! 285: #define KBDCRESET _IO(k,2) /* reset keyboard to standard */ ! 286: #define KBDCRST _IO(k,3) /* reset (clear) string table */ ! 287: #define KBDCSSTD _IO(k,4) /* set standard table */ ! 288: #define KBDSGET _IOR(k,5,int) /* get available string space */ ! 289: #define KBDGCLICK _IOR(k,6,int) /* get click */ ! 290: #define KBDSCLICK _IOW(k,7,int) /* set click */ ! 291: ! 292: .ft R ! 293: .fi ! 294: .RE ! 295: The applicable codes are: ! 296: .IP KBDCRESET 18 ! 297: Reset the keyboard definitions to the standard definitions. ! 298: The ! 299: .I arg ! 300: argument is unused. ! 301: .IP KBDRST ! 302: Clear the string definitions. This makes space available for ! 303: a new set of strings to be defined. It causes any key with a definition ! 304: of more than two bytes to be set to the ! 305: FN_IGNORE function. ! 306: .IP KBDSSTD ! 307: Replace the standard definition with the current definition. ! 308: .IP KBDSGET ! 309: Store the number of bytes available for string definitions ! 310: in the \fIint\fP pointed to by \fIarg\fP. ! 311: .IP KBDCGET ! 312: Store the current definition for ! 313: scancode \fIkbd_scan\fP at index \fIkbd_index\fP ! 314: in the \fIstruct kbdarg\fP pointed to by \fIarg\fP. ! 315: The keyboard ! 316: index is one of KBD_INDEX_NORMAL, KBD_INDEX_SHIFT, ! 317: KBD_INDEX_CONTROL, KBD_INDEX_ALT or KBD_INDEX_ACTION. ! 318: On the \fIioctl\fP, the \fIkbd_length\fP contains the maximum length to ! 319: return; upon return it contains the actual length stored in the keyboard. ! 320: The definition is returned into \fIkbd_text\fP. ! 321: .IP KBDCSET ! 322: Store a new definition for scancode \fIkbd_scan\fP at index \fIkbd_index\fP ! 323: in the keyboard from \fIstruct kbdarg\fP pointed to by \fIarg\fP. ! 324: The keyboard index is one of KBD_INDEX_NORMAL, KBD_INDEX_SHIFT, ! 325: KBD_INDEX_CONTROL, KBD_INDEX_ALT or KBD_INDEX_ACTION. ! 326: \fIkbd_length\fP contains the length of the definition text ! 327: in \fIkbd_text\fP. ! 328: .IP KBDGCLICK ! 329: Store the current keyboard click status into the \fIint\fP pointed to by ! 330: \fIarg\fP. The value is one of CLICK_OFF, CLICK_HARD, ! 331: CLICK_SOFT or CLICK_BOTH. ! 332: .IP KBDSCLICK ! 333: Set the current keyboard click status from the \fIint\fP pointed to by ! 334: \fIarg\fP. The value must be one of CLICK_OFF, CLICK_HARD, ! 335: CLICK_SOFT or CLICK_BOTH. ! 336: .IP ! 337: .SH ERRORS ! 338: The following errors can be returned by the driver: ! 339: .TP 12 ! 340: [EINVAL] ! 341: The \fIkbd_scan\fP or \fIkbd_index\fP is invalid. ! 342: .TP 12 ! 343: [E2BIG] ! 344: The string being defined exceeds the available space. ! 345: .TP 12 ! 346: [EPERM] ! 347: The caller is not the super-user (for the KBDSSTD ioctl). ! 348: .SH FILES ! 349: /dev/console ! 350: .SH "SEE ALSO" ! 351: cons(4), ibm5151(4), ibmaed(4), tty(4), reboot(8), debug(i), pf(i) ! 352: .SH DIAGNOSTICS ! 353: None. ! 354: .SH BUGS ! 355: .PP ! 356: The console screen print function works only for the monochrome display ! 357: and the IBM Academic Information Systems experimental display. ! 358: .PP ! 359: The only user output to the speaker is a beep (\fBbel\fR). ! 360: It should be possible to ! 361: control the speaker's frequency and duration parameters. ! 362: .PP ! 363: Caps-Lock mode should be enhanced. ! 364: Using the shift key when in Caps-Lock mode should generate lower case ! 365: letters; also, Caps-Lock should not shift non-alphabetic characters. ! 366: .PP ! 367: Num-Lock mode does not do anything; the numeric pad generates numbers ! 368: regardless of mode.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.