Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pf(1) — AOS 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cons(4)

kbdemul(4)

keyboard_codes(5)

PF(1)  —  

NAME

pf − set keyboard program-function keys

SYNOPSIS

pf [ −f codes ] [ −d ] [ −S ] [ −z ] [ −r ] [ −e command ] [ file . . . ]

DESCRIPTION

Pf redefines keys on the IBM RT PC or IBM 6152 Academic System keyboard.  It can be called interactively or it can be invoked from a script, such as from .login or .profile during login processing.  Options and files can be interspersed on the command line and are processed in the order encountered.  If no files or -e options are specified, input is from standard input.  The following options are available:

−e Take the next argument as a pf command.  This is the usual way of doing quick definitions from the keyboard or a shell script. 

−d Print debugging messages. 

−f Take the following argument as the codes file instead of the default /usr/lib/keyboard_codes (see keyboard_codes(5)).  This file contains the mapping of scan codes to key names. 

−S Replace the standard set of keyboard definitions with the current set (see kbdemul(4)).  This can be done only by the super-user. 

−r Reset the current keyboard definitions to the standard definitions. 

−z Clear the current keyboard string definitions. This is useful for clearing out old definitions to make room for a new set. 

COMMANDS

The following commands can be issued interactively or from a file (e.g., during .login processing).  Pf ignores empty lines and lines that begin with #. 

help Print a short help message. 

display name

print name
Display the current definitions associated with name. Name is either a single scan code or the word all.  A scan code consists of an optional prefix followed by a scan-number (decimal) or by the symbol on the appropriate keycap.  The prefixes are shift-, control- (or various synonyms), alt-, or action-.  For example, alt-a specifies the alt shift of the a key. 

set name=string
Specify a new definition for name.  String may use “\” and “^” to specify special characters that would otherwise be difficult to enter (or would take effect immediately).  The “\” can be followed by the standard C character escapes.  The “^” specifies a control character.  String is terminated by the end of the line. 

reset Reset the keyboard definitions to the standard definitions. 

sstd Set the standard definitions from the current definitions.  This may only be done by the super-user. 

safe on

safe yes
Turn on safe mode. In safe mode, it is not possible to redefine normal alphabetic characters and the <Enter> key. 

safe off

safe no
Turn off safe mode. In unsafe mode, it is possible to redefine any key on the keyboard. 

click off

click no
Turn off all keyboard clicks (silent keystrokes).  Not supported for the IBM 6152 Academic System.

click hard

click on

click yes
Turn on hardware keyboard clicks (default). The hardware click is a short, sharp click. Not supported for the IBM 6152 Academic System.

click soft
Turn on software keyboard clicks. The software click is entirely independent of the hardware click. It has a different tone and duration. Not supported for the IBM 6152 Academic System.

click both
Turn on both hardware and software clicks. Not supported for the IBM 6152 Academic System.

click ? 
Print the current keyboard click mode. Not supported for the IBM 6152 Academic System.

end Terminate pf. 

quit Terminate pf. 

NOTES

It is possible to redefine a key to have a meta or shift function.  In this case, string is the name of the meta function enclosed in braces.  For example, the command line:
set alt-page-up={FN_SWITCH}
causes the <Alt> key plus the <Page-Up> key to switch the console output to the next screen (the FN_SWITCH function).  For more details on the available functions, see kbdemul(4).  If it is necessary to generate a string that is the name of a function key inside braces, then the backslash octal escape for the left brace (\173) can be used. 

Pf defaults to safe mode when invoked with input from a terminal; otherwise it operates in unsafe mode.  To override this, issue the command safe off. 

It is possible to use pf to reorganize the keyboard into different key layouts; in this case, move the key caps and change the /usr/lib/keyboard_codes file. 

Pf can only be used if kbdemul(4) is the input emulator. 

EXAMPLES

The following pf command defines the Alt shift of the b key to generate a Ctrl-Z (“^Z”) and then issue the “bg” csh command, to put the currently-running process in the background: set alt-b=^Zbg^M
 

The following remaps keys at each login.  In .login, place the line:
 
if (‘tty‘ == /dev/console) pf  ~ /.login.kbd
 
and create the file .login.kbd:
 

# reset to standard, put caps-lock
# and control in convenient places,
# define control-‘ and alt-b.
reset
set caps-lock={FN_CONTROL}
set ctrl={FN_CAPS_LOCK}
set control-‘=^M~^Z^M
set alt-b=^Zbg^M
click off

To turn key click off: pf -e ”click off”

Click off is not supported for the IBM 6152 Academic System. 

FILES

/usr/lib/keyboard_codes defines the standard scancode bindings. 

DIAGNOSTICS

Diagnostics are intended to be self-explanatory, except for messages of the form:
 
    ioctl KBD type reason
 
which indicate the given ioctl failed for the given reason. 

SEE ALSO

cons(4), kbdemul(4), keyboard_codes(5)

BUGS

Pf does not reorganize the string definitions when the string area is full. 

PRPQs 5799-WZQ/5799-PFF: IBM/4.3  —  Dec 1987

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