Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setkey(C) — OpenDesktop 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

keyboard(HW)

scancode(HW)


 setkey(C)                       19 June 1992                       setkey(C)


 Name

    setkey - assign the function keys

 Syntax

    setkey keynum string

 Description

    The setkey command assigns the given ANSI string to be the output of the
    computer function key given by keynum.  For example, the command:

       setkey 1 date

    assigns the string "date" as the output of function key 1.  The string
    can contain control characters, such as a newline character, and should
    be quoted to protect it from processing by the shell.  For example, the
    command:

       setkey 2 "pwd ; lc\n"

    assigns the command sequence "pwd ; lc" to function key 2.  Notice how
    the newline character is embedded in the quoted string.  This causes the
    commands to be carried out when function key 2 is pressed. Otherwise, the
    <Enter> key would have to be pressed after pressing the function key, as
    in the previous example.

    setkey translates ``^'' into ``^^'', which, when passed to the screen
    driver, is interpreted as a right angle bracket (>), or greater than key.

 Notes

    setkey works only on the console keyboard and on terminals running in
    scancode mode.

    The function keys are defined in the string mapping table.  This is an
    array of 512 bytes (typedef strmapt) where null terminated strings can
    be put to redefine the function keys. The first null terminated string is
    assigned to the first string key, the second to the second string key,
    and so on.  There is one string mapping table per multi-screen.

    Although the size of the setkey string mapping table is 512 bytes, there
    is a limit of 30 characters that can be assigned to any individual func-
    tion key.

    Assigning more than 512 characters to the string mapping table causes the
    function key buffer to overflow. When this happens, the sequences sent by
    the arrow keys are overwritten, effectively disabling them.  Once the
    function key buffer overflows, the only way to enable the arrow keys is
    to reboot the system.

    The table below lists the keynum values for the function keys:

    _____________________________________________________________
         Function key   keynum        Function key         keynum
    __________________________|__________________________________
         <F1>           1     |       <Ctrl><F10>          34
         <F2>           2     |       <Ctrl><F11>          35
         <F3>           3     |       <Ctrl><F12>          36
         <F4>           4     |       <Ctrl><Shift><F1>    37
         <F5>           5     |       <Ctrl><Shift><F2>    38
         <F6>           6     |       <Ctrl><Shift><F3>    39
         <F7>           7     |       <Ctrl><Shift><F4>    40
         <F8>           8     |       <Ctrl><Shift><F5>    41
         <F9>           9     |       <Ctrl><Shift><F6>    42
         <F10>          10    |       <Ctrl><Shift><F7>    43
         <F11>          11    |       <Ctrl><Shift><F8>    44
         <F12>          12    |       <Ctrl><Shift><F9>    45
         <Shift><F1>    13    |       <Ctrl><Shift><F10>   46
         <Shift><F2>    14    |       <Ctrl><Shift><F11>   47
         <Shift><F3>    15    |       <Ctrl><Shift><F12>   48
         <Shift><F4>    16    | _________________________________
         <Shift><F5>    17    |       Numeric Key-Pad      keynum
         <Shift><F6>    18    | _________________________________
         <Shift><F7>    19    |               7            49
         <Shift><F8>    20    |               8            50
         <Shift><F9>    21    |               9            51
         <Shift><F10>   22    |               -            52
         <Shift><F11>   23    |               4            53
         <Shift><F12>   24    |               5            54
         <Ctrl><F1>     25    |               6            55
         <Ctrl><F2>     26    |               +            56
         <Ctrl><F3>     27    |               1            57
         <Ctrl><F4>     28    |               2            58
         <Ctrl><F5>     29    |               3            59
         <Ctrl><F6>     30    |               0            60
         <Ctrl><F7>     31    |
         <Ctrl><F8>     32    |
         <Ctrl><F9>     33    |

    For a table of the escape sequences, refer to keyboard(HW).

 File

    /bin/setkey

 See also

    keyboard(HW), scancode(HW)

 Value added

    setkey is an extension of AT&T System V provided by The Santa Cruz Opera-
    tion, Inc.


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