[comp.unix.aix] Emacs 18.56 Function Keys on RS/6000-320

marc@ladwp.uucp (Marc Hall) (02/26/91)

 We would like to bind the function keys f1-f12 on the IBM RS/6000-320 keyboard
to specific emacs fucntions but have been unable to determine the complete 
character sequences emitted by these keys. The emacs version is 18.56 and is
using its own X window on the 320 display. 

 When the function keys are pressed while in a Emacs scratch buffer, the display
behaves as if the C-g (bell) key had been pressed and then the following
key sequences appear in the buffer :

             f1 - 01q
             f2 - 02q
              .    .
              .    .
              .    .
            f12 - 12q
            and so on...

 Does anyone know what the complete character sequences being emitted by the 
function keys are ?

Marc Hall
(213) 481-4735
elroy.jpl.nasa.gov!ladwp!marc

slh@wolf.cs.washington.edu (Scott Heyano) (02/27/91)

In article <137@ladwp.ladwp.com> marc@ladwp.uucp (Marc Hall) writes:
[stuff]
| When the function keys are pressed while in a Emacs scratch buffer, the display
|behaves as if the C-g (bell) key had been pressed and then the following
|key sequences appear in the buffer :
|
|             f1 - 01q
|             f2 - 02q
|              .    .
|              .    .
|              .    .
|            f12 - 12q
|            and so on...
|
| Does anyone know what the complete character sequences being emitted by the 
|function keys are ?
|
	I think <ESC>[ is the prefix.
	<ESC>[ is bound to the backward-paragraph function,
	so if you were at the beginning of the buffer,
	you should get a beep and a msg saying you are at the
	beginning of buffer.

db3l@ibm.com (David Bolen) (02/27/91)

In article <137@ladwp.ladwp.com> marc@ladwp.uucp (Marc Hall) writes:

>We would like to bind the function keys f1-f12 on the IBM RS/6000-320 keyboard
>to specific emacs fucntions (...)
>
>When the function keys are pressed while in a Emacs scratch buffer, the
>display >behaves as if the C-g (bell) key had been pressed and then the
>following key sequences appear in the buffer :
>
>      f1 - 01q
>      f2 - 02q
>       .    .
> (...)

Well, the first thing you need to do is to make sure that you use Ctrl-Q
before pressing any function key.  Otherwise, the sequence that the function
key sends will be interpreted by GNU Emacs as normal editing keys.  As the
codes do not represent valid editing keys, you get the beep.

That said, the codes you are missing are ESC[0, at least for the function
keys.  That is, F1 is ESC[001q, F2 is ESC[002q, etc..  Some other the other
special keys use all three digits, like ESC[128q or something.  I don't have
an exhaustive list handy, but you can certainly figure out anything you want
in a scratch buffer.  Just remember the Ctrl-Q before hitting the key you are
trying to check.

Note that to define these keys, you may need to define a new keyboard map
for the ESC-[ sequence.  My term file for the hft terminal uses:

	(define-key esc-map "[" (make-sparse-keymap))
	(global-unset-key "[")

at the beginning prior to using a bunch of (global-set-key) statements to
assign the keys to functions.

--
-- David
--
/-----------------------------------------------------------------------\
 \                             David Bolen                             /
  |    Laboratory Automation, IBM Thomas J. Watson Research Center    |
 /              P.O. Box 218, Yorktown Heights, NY  10598              \
| - - - - - - - - - - - -  M i t h r a n d i r  - - - - - - - - - - - - |
| Internet : db3l@ibm.com                    | Bitnet : db3l@yktvmv     |
| Usenet   : uunet!bywater!arnor!larios!db3l | Phone  : (914) 945-1940  |
|   /---------------------------------------------------------------\   |
 \-( All comments/opinions are mine and don't represent those of IBM )-/
    \---------------------------------------------------------------/