[comp.sys.hp] SUMMARY Response: HP keyboard mappings

susan@slovax.WA.COM (susan) (01/12/91)

Thanks to all who responded, the help was appreciated.
For those who may benefit, the following are excerpts from
some of the responses I received.  We did find a TERM 0 
reference manual hidden away/rescued from archives after I 
posted the question.

>For HP keyboard (product number 46021A): 

>Does anyone out there know what the default function
>key mappings are?  Or what reference to find this
>information in?  We cant find it in our references and
>have been woefully unsuccessfull trying to trap
>input from the function keys or even just
>define them.
------------
f1	ESC p
f2	ESC q
f3	ESC r
f4	ESC s
f5	ESC t
f6	ESC u
f7	ESC v
f8	ESC w
------------
I use on older manual that is no longer shipped with the 6.5, 7.0 or 
later HP-UX manual set.  It is the TERM 0 Reference, and describes the 
low level behavior, keystroke codes, and attribute control for the ITE,
the built-in Integrated Terminal Emulator that runs on the console of the
HP systems. This manual describes the function keys.  It has been
awhile, but I know we used curses and the information in the TERM 0 
reference to get complete control of the console as a terminal.  A lot of the
information applies to HP terminals in general.
--------------
The function keys F1 to F8 transmit 
   ESC p <CR>
to
   ESC w <CR>
on HP terminals. You sometimes have to set up the "straps" to make sure
they are transmitted and don't invoke a local setup function or something.

If you want to trap arrow keys, page-up etc, you'll have to put the
terminal into transmit-function mode (XmitFnctn strap). The sequence
to do this is
   ESC & s 1 A
and to set it back again is
   ESC & s 0 A

After this, you'll get the following sequences back
   Cursor UP    -   ESC A
   Cursor DOWN  -   ESC B
   Cursor RIGHT -   ESC C
   Cursor LEFT  -   ESC D


    HP2392A Display Terminal Reference Manual
    part number 02390-900001
-----------------------------------------------------------
The following script shows the proper usage of tput to determine the values
of the function keys.

#!/bin/sh
# This program reports the name of the function key pressed

f1=`tput kf1`
f2=`tput kf2`
f3=`tput kf3`
f4=`tput kf4`
f5=`tput kf5`
f6=`tput kf6`
f7=`tput kf7`
f8=`tput kf8`

flag=0
while [ "$flag" = "0" ]
do
	read akey
	case $akey in
		$f1 )	echo "f1";;
		$f2 )	echo "f2";;
		$f3 )	echo "f3";;
		$f4 )	echo "f4";;
		$f5 )	echo "f5";;
		$f6 )	echo "f6";;
		$f7 )	echo "f7";;
		$f8 )	echo "f8";;
		*)	flag=1;break;;
	esac
done
exit 0

Jim Rogers
Hewlett Packard Company
Logic Systems Division
---------------------------------------

susan@slovax.wa.com
Disclaimer:  RDA aint responsible