[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Oct 16 21:28:43 1994 
Subject:Re: xvedkeys F11 and F12 on SUN Type 4 Keyboards 
From:Aaron Sloman 
Volume-ID:941017.01 

adw@Reading.ac.uk (Anthony Worrall) writes:

> Date: Thu, 13 Oct 1994 07:57:23 GMT
> Organization: The University of Reading
>
> The function keys marked F11 and F12 (XSym SUNXK_F16 and SUNXK_F37) on a SUN Type4
> keyboard generate the sequence \^P and \^Q instead of \^[[FFC8 and \^[[FFC9
> as one would expect.

Why would you expect this? Under X it would depend on which
application you are using.

On my IPC sparcstation with a typ3 4 keyboard F11 and F12 originally
did not transmit anything in an ordinary xterm window, and therefore
did nothing in ordinary VED, and transmitted ^P and ^Q in XVed
(which I hardly ever use).

I fixed this by experimenting with xev to find the keycodes and
putting the following instructions in my X startup file

    # Make F11 and F12 recognized
     xmodmap -e "keycode 16 = F11"
     xmodmap -e "keycode 18 = F12"

After that how the keys behave can vary from application to
application, depending on how F11 and F12 are specified.

Here's my entry in my .Xdefaults for xterm windows (and thus
ordinary VED)
-------------------------------------------------------------------
! xterm translations to make ordinary VED work
XTerm*VT100*Translations: #override \
    <Key>Num_Lock: string(0x1b) string("[110~") \n\
    <Key>R1: string(0x1b) string("[111~") \n\
    <Key>R2: string(0x1b) string("[112~") \n\
    <Key>R3: string(0x1b) string("[113~") \n\
    <Key>R4: string(0x1b) string("[114~") \n\
    <Key>R5: string(0x1b) string("[115~") \n\
    <Key>R6: string(0x1b) string("[117~") \n\
    <Key>R7: string(0x1b) string("[118~") \n\
    <Key>R8: string(0x1b) string("[119~") \n\
    <Key>R9: string(0x1b) string("[120~") \n\
    <Key>R10: string(0x1b) string("[121~") \n\
    <Key>R11: string(0x1b) string("[123~") \n\
    <Key>R12: string(0x1b) string("[124~") \n\
    <Key>R13: string(0x1b) string("[125~") \n\
    <Key>R14: string(0x1b) string("[126~") \n\
    <Key>R15: string(0x1b) string("[128~") \n\
    <Key>Up: string(0x1b) string("[A") \n\
    <Key>Down: string(0x1b) string("[B") \n\
    <Key>Right: string(0x1b) string("[C") \n\
    <Key>Left: string(0x1b) string("[D") \n\
    <Key>KP_Enter: string(0x1b) string("OM") \n\
    <Key>KP_Add: string(0x1b) string("Ok") \n\
    <Key>KP_Subtract: string(0x1b) string("Om") \n\
    <Key>KP_0: string(0x1b) string("Op") \n\
    <Key>KP_Decimal: string(0x1b) string("On") \n\
    <Key>Help: string(0x1b) string("K") \n\
    <Key>Home: string(0x1b) string("<") \n\
    <Key>End: string(0x1b) string(">") \n\
    Meta <Key>1: set-vt-font(1) \n\
    Meta <Key>2: set-vt-font(2) \n\
    Meta <Key>3: set-vt-font(3) \n\
    Meta <Key>4: set-vt-font(4) \n\
    Meta <Key>0: set-vt-font(0) \n\
    Meta <Key>R: set-reverse-video(toggle) \n\
    Meta <Key>T: set-altscreen(toggle) \n\
    Meta <Key>I: insert-selection(PRIMARY,CUT_BUFFER0) \n\
    Meta <Key>F9: insert-selection(PRIMARY,CUT_BUFFER0) \n\
    Meta <Key>F1: select-cursor-start() select-cursor-end(PRIMARY,CUT_BUFFER0) \n\
    Meta <Key>F2: start-cursor-extend() select-cursor-end(PRIMARY,CUT_BUFFER0)\n
-------------------------------------------------------------------

And here's what I use to control XVed (which uses the XpwScrollText
widget:
!  translations to make XVED work
*XpwScrollText*Translations: #override \
    <Key>Num_Lock: string(0x1b) string("[110~") \n\
    <Key>F1: string(0x1b) string("[11~") \n\
    <Key>F2: string(0x1b) string("[12~") \n\
    <Key>F3: string(0x1b) string("[13~") \n\
    <Key>F4: string(0x1b) string("[14~") \n\
    <Key>F5: string(0x1b) string("[15~") \n\
    <Key>F6: string(0x1b) string("[17~") \n\
    <Key>F7: string(0x1b) string("[18~") \n\
    <Key>F8: string(0x1b) string("[19~") \n\
    <Key>F9: string(0x1b) string("[20~") \n\
    <Key>F10: string(0x1b) string("[21~") \n\
    <Key>F11: string(0x1b) string("[23~") \n\
    <Key>F12: string(0x1b) string("[24~") \n\
    <Key>R1: string(0x1b) string("[111~") \n\
    <Key>R2: string(0x1b) string("[112~") \n\
    <Key>R3: string(0x1b) string("[113~") \n\
    <Key>R4: string(0x1b) string("[114~") \n\
    <Key>R5: string(0x1b) string("[115~") \n\
    <Key>R6: string(0x1b) string("[117~") \n\
    <Key>R7: string(0x1b) string("[118~") \n\
    <Key>R8: string(0x1b) string("[119~") \n\
    <Key>R9: string(0x1b) string("[120~") \n\
    <Key>R10: string(0x1b) string("[121~") \n\
    <Key>R11: string(0x1b) string("[123~") \n\
    <Key>R12: string(0x1b) string("[124~") \n\
    <Key>R13: string(0x1b) string("[125~") \n\
    <Key>R14: string(0x1b) string("[126~") \n\
    <Key>R15: string(0x1b) string("[128~") \n\
    <Key>Up: string(0x1b) string("[A") \n\
    <Key>Down: string(0x1b) string("[B") \n\
    <Key>Right: string(0x1b) string("[C") \n\
    <Key>Left: string(0x1b) string("[D") \n\
    <Key>KP_Enter: string(0x1b) string("OM") \n\
    <Key>KP_Add: string(0x1b) string("Ok") \n\
    <Key>KP_Subtract: string(0x1b) string("Om") \n\
    <Key>KP_Multiply: string(0x1b) string("Oj") \n\
    <Key>KP_Divide: string(0x1b) string("Oo") \n\
    <Key>KP_0: string(0x1b) string("Op") \n\
    <Key>KP_Decimal: string(0x1b) string("On") \n\
    <Key>KP_1: string(0x1b) string("Oq") \n\
    <Key>KP_2: string(0x1b) string("Or") \n\
    <Key>KP_3: string(0x1b) string("Os") \n\
    <Key>KP_4: string(0x1b) string("Ot") \n\
    <Key>KP_5: string(0x1b) string("Ou") \n\
    <Key>KP_6: string(0x1b) string("Ov") \n\
    <Key>KP_7: string(0x1b) string("Ow") \n\
    <Key>KP_8: string(0x1b) string("Ox") \n\
    <Key>KP_9: string(0x1b) string("Oy") \n\
    <Key>Help: string(0x1b) string("K") \n\
    <Key>Home: string(0x1b) string("<") \n\
    <Key>End: string(0x1b) string(">") \n\
    <Key>Insert: string(0x1b) string("[2~") \n\
    <Key>Prior: string(0x1b) string("[5~") \n\
    <Key>Next: string(0x1b) string("[6~")\n
-------------------------------------------------------------------

Note that these ensure that on keyboards where there are arrow
keys Up,Down, Left, Right separate from the keypad keys 2,4,6,8
(.e. R14, R10, R12, R8), then the two lots of keys transmit
different sequences so that they can do different things.
Unfortunately the default setup is often that they transmit the same
things, which I find quite silly as it loses the benefit of having
different keys.

Here at Birmingham, because we use a variety of different keyboards,
we have tried to get some consistency in the behaviour of the
function keys, and also consistency between VED and XVED. Thus in
all cases the function keys F1 to F9 with and without ESC work thus:


     (Note: "linepart" means most recently deleted part line segment.)

        F1       F2       F3       F4       F5        F6       F7
     +--------+--------+--------+--------+--------+--------+--------+
 Esc | mk top | mk end | yank   | yank   | yank   | yank   | yank   |
+Key | file   | file   |linepart| line   |linepart|linepart|linepart|
-----+--------+--------+--------+--------+--------+--------+--------+
 KEY | MARK   | MARK   | DELETE | DELETE | DELETE | DELETE | DELETE |
     | BEGIN  | END    | LINE < | LINE   | LINE > | WORD < | WORD > |
     +--------+--------+--------+--------+--------+--------+--------+


         F8       F9
     +--------+--------+
 Esc | move   | copy   |
+Key | in     | in     |
-----+--------+--------+
 KEY | MOVE   | COPY   |
     | RANGE  | RANGE  |
     +--------+--------+

And where F10 exists it does:

         F10
     +--------+
 Esc | move   |
+Key | out    |
-----+--------+
 KEY |XREFRESH|
     |        |
     +--------+

For some reason we have not sorted out F11 and F12.

All the libraries required for this are in our ftp directory

    ftp://ftp.cs.bham.ac.uk/pub/dist/poplog

        in sub-directories auto and help
--
Aaron Sloman,
School of Computer Science, The University of Birmingham, B15 2TT, England
EMAIL   A.Sloman@cs.bham.ac.uk  OR A.Sloman@bham.ac.uk
Phone: +44-(0)21-414-4775       Fax:   +44-(0)21-414-4281