Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Remap function keys to shifted function keys

 
SOLVED
Go to solution
R. Lewis
Occasional Visitor

Remap function keys to shifted function keys

Summary:
I would like to know how to get function keys F11-F20 to map to Shift-F1 to Shift-F10 on a Windows based Xserver connecting to Xwindows on OpenVMS


Folks,

I have been trying to use an OpenVMS Alpha system over Xwindows on a Windows PC instead of a VT terminal emulator.

Through the use of an Windows based XWindows server, I have been able to establish an XWindows logon just as if I were at the system console.

However, one of my applications requires the use of the keys F7-F20. On the system console, I of course have dedicated physical keys for these function keys (it is a LK411 keyboard). However, on a PC I only have F1-F12.

I would like to make the function keys F11-F20 work as F1-F10 when shifted, i.e. Shift-F2=F12.

I wrote a simple DCL script to define the programmable keys to output the name of the key pressed, i.e.:

$ ! KEY_TEST.COM
$ set terminal /application_keypad
$ set terminal /noline_editing
$ define /key PF1 "PF1 "
$ define /key PF2 "PF2 "
.
.
.
$ define /key F19 "F19 "
$ define /key F20 "F20 "

On a VT terminal emulator, I was able to get all the keys to work (by modifying the default key-mapping), including keys F11-F20 (except on this emulator, F11-F20 is defined as CTRL+F1, etc.). When I press "F13" (i.e. CTRL-F3), I get "F13 " shown on the screen (when using the KEY_TEST.COM script).

Both the VT terminal emulator and Xwindows server have a means to redefine the output of the keyboard. I have done so on both the VT and Xwindows. For the Xwindows, I have defined Shift-F1 to be F11, Shift-F2 to be F12, etc.

Using xev within a DECterm, I have determined that I can get F11-F20 by using the shift key. But at a DECterm system prompt ($), all I get is a beep.

Not related to the function keys, but I have also noted that when in Xwindows on OpenVMS, the comma/less and period/greater keys will not work when shifted. This is applicable not only through Kea! X, but on the console itself! By not working, I mean that when in a DECterm, and press with the shift key the comma/less key (keycode 232 on the LK411, and 58 on a 101 keyboard) or the period/greater key (237 on the LK411, and 59 on the 101 keyboard), the less than and greater symbols are not shown. However, I can type at the prompt:

$ xmodmap –e "keycode 58=less comma"
$ xmodmap –e "keycode 59=greater period"

And now I can get to the comma, less, period, and greater symbols (they are backwards to what is shown on the keyboard, but oh well).

Anybody know what is going on there?

Particulars:

I am on a Windows XP SP2 system using Kea! X Server v6.00.191 (by
Attachmate). Furthermore, I am on OpenVMS 7.3-1 using DecWindows
Motif 1.2-6 for OpenVMS.

Any help would be greatly appreciated.
8 REPLIES 8
Hoff
Honored Contributor

Re: Remap function keys to shifted function keys

The answer you got out in your c.o.v. discussion thread:

http://groups.google.com/group/comp.os.vms/browse_thread/thread/c8651b4866af1c7d

looks basically right; this certainly appears to be the X Window System Server running on Microsoft Windows, and its doing. The X Window Server (running on the Windows PC) maps and then sends over the keyboard input, and OpenVMS and its clients field it as it arrives.

Some options: try a different emulator. Try a different X Window Server on Windows. Try a Mac and its X11. Try the VTstar terminal emulator from the OpenVMS Freeware, or PuTTY. try an LK250 or LK450, or an LK46* series keyboard, depending on the box.

Check the keyboard settings, too, as there are some indications at the Attachmate KEA site of alternate mappings. Here's something that looks potentially useful here, and directly from the Attachmate (KEA) folks:

http://support.attachmate.com/techdocs/1701.html

Again, OpenVMS X Window client applications (DECterm, etc) are basically at the mercy of whatever the X Window Server decides to send over...

And yes, Windows-based X Window System servers can and often will display various degrees of "suckage." I don't have a whole lot of experience with the KEA product, so I can't compare that.
Wim Van den Wyngaert
Honored Contributor

Re: Remap function keys to shifted function keys

Have the same reaction on VMS 7.3 with KEA!X 4.1. Also looked for a solution. Invain.

Wim
Wim
Wim Van den Wyngaert
Honored Contributor
Solution

Re: Remap function keys to shifted function keys

Searching helps.

Found that the > and < sign are not displayed
because the DECTERM / KEYBOARD option say ". sends .". Change it and the <> signs are shown.

Wim
Wim
Wim Van den Wyngaert
Honored Contributor

Re: Remap function keys to shifted function keys

BTW : the . sends .
also applies to normal workstations.
Wim
EdgarZamora_1
Respected Contributor

Re: Remap function keys to shifted function keys


Hoff I like that new word you invented, "suckage".
R. Lewis
Occasional Visitor

Re: Remap function keys to shifted function keys

Hoff,

I am not entirely convinced that the shifted function keys problem is a Kea! X Windows server problem.

Consider this excerpt from running DECW$UTILS:XMODMAP â pke on the console (using the LK411 keyboard):

! Normal Shift
keycode 86 = F1
keycode 87 = F2
keycode 88 = F3
keycode 89 = F4
keycode 90 = F5
â ¦
keycode 100 = F6
keycode 101 = F7
keycode 102 = F8
keycode 103 = F9
keycode 104 = F10
â ¦
keycode 113 = F11
keycode 114 = F12
keycode 115 = F13
keycode 116 = F14
â ¦
keycode 128 = F17
keycode 129 = F18
keycode 130 = F19
keycode 131 = F20

If I run key_test.com, I see F6-F14, and F17-F20.

Now, I write a file that modifies these xmodmap expressions, like this:

! Normal Shift
keycode 86 = F1 F11
keycode 87 = F2 F12
keycode 88 = F3 F13
keycode 89 = F4 F14
keycode 90 = F5
â ¦
keycode 100 = F6
keycode 101 = F7 F17
keycode 102 = F8 F18
keycode 103 = F9 F19
keycode 104 = F10 F20
â ¦
keycode 113 = NoSymbol
keycode 114 = NoSymbol
keycode 115 = NoSymbol
keycode 116 = NoSymbol
â ¦
keycode 128 = NoSymbol
keycode 129 = NoSymbol
keycode 130 = NoSymbol
keycode 131 = NoSymbol

and run xmodmap on the above file, and then run the key_test.com script, I can see F6-F10. However, when I press shift-F1 thru shift-F10, I get the beep, and no output on the screen, just as I was when I was on the PC X server. Note that I am on the console though, not the X server. Also, pressing the actual keys F11-F20 now produce no output.

However, I can make this file:

! Normal Shift
keycode 86 = F11 F1
keycode 87 = F12 F2
keycode 88 = F13 F3
keycode 89 = F14 F4
keycode 90 = F5
â ¦
keycode 100 = F6
keycode 101 = F17 F7
keycode 102 = F18 F8
keycode 103 = F19 F9
keycode 104 = F20 F10
â ¦
keycode 113 = NoSymbol
keycode 114 = NoSymbol
keycode 115 = NoSymbol
keycode 116 = NoSymbol
â ¦
keycode 128 = NoSymbol
keycode 129 = NoSymbol
keycode 130 = NoSymbol
keycode 131 = NoSymbol

and run xmodmap on the above file. Now when I press the F1 key, I get F11, but hitting Shift-F1 does not yield F1, but the beep again and no output.

For all of the above scenarios, I can provide xev outputs. In all cases, xev shows to match the definition of what is in the xmodmap file, but does not work at the prompt.

I have used xev and xmodmap. Could xmbind help me here? I believe it is used to configure virtual keybindings of Motif applications. Is DECterm a Motif application? I would assume it is. However, I do not have any experience with xmbind or Motif.

And Wim, thank you very much for the hint on the DECterm/Options/Keyboard . sends .>. That fixed that problem. I also saw this in the documentation for xmodmap on cygwin using the expressions "keysym comma=comma less" and "keysym period=period greater".
Hoff
Honored Contributor

Re: Remap function keys to shifted function keys

So that I'm clear on this, your goal is to remap your keyboard to map to those expected by OpenVMS application, and you're not in a position to connect an OpenVMS LK463 or LK464 keyboard. You're using one of various PC keyboards on the PC (and not an LK), and (for whatever reasons) you've ruled out use of terminal emulation. Correct?

As for your listings I'd ask that you be somewhat specific as to your configuration testing. (That, and text-file attachments work better as far as formatting than does stuff in this little tiny input box.) For instance, you reference keyboards and xmodmap, and these are available on both OpenVMS and on various X Window Servers. Is the LK411 connected to OpenVMS? To the PC?

In particular, where is the keyboard input arriving from?

Have you looked to see what keycodes are arriving? (xev is good here.)

What happens when you issue the control sequence for the function key directly? (From the Windows environment.) "CSI 3 4 ~" is the sequence for F20.

And does the PC even pass along the keycodes?

Does loading up and trying another option like Xming work around this?

There are keymaps on the Freeware. Here:
http://mvb.saic.com/freeware/freewarev70/decxterm/freeware_readme.txt

And have you looked at what Attachmate provides for documentation?

And here's a good write-up on xterm, the classic X Windows terminal emulator:

http://invisible-island.net/xterm/xterm.faq.html#how2_fkeys

BTW, the "beep" you refer to usually means something happened. Maybe not what you expect... Use xev to verify that.

And you might want to grab a copy of XKeycaps from:
http://www.jwz.org/hacks/
http://wwwvms.mppmu.mpg.de/~huber/pds/xkeycaps/
as it can be easier than dealing with xmodmap.

On a site node, I should post up the Mac OS X keyboard maps for DECterm. The local site is lacking in Windows boxes, so I don't have a way to test there.

And in general, I'd suggest you ring up Attachmate and ask them for help here. You're working with a third-party X emulator on a non-OpenVMS platform; a combination that's not exactly the sweet spot for this ITRC forum. Certainly report back what the Attachmate/WRQ folks have to say...

R. Lewis
Occasional Visitor

Re: Remap function keys to shifted function keys

Folks,

I believe I have a working solution, however,
if anyone can explain how it works, I would appreciate it.

I discovered that by pressing the ALT key on the LK411 keyboard (or only the right ALT key on a PC using KEA! X, as Kea reserves the left ALT key for Windows) in addition to F1-F3 and F7-F9, I was able to get F11-F13 and F17-F19. F14 was a problem because Motif defines ALT-F4 as close window. F20 (ALT-F10) pulls up a menu.

I was able to get rid of the ALT-F10 (F20) problem by making a custom DTWMRC.DAT file in my .DT directory. Now ALT-F10 outputs a F20. And I just mapped the pause/break key on a PC to F14.

I guess my questions are this (these being for my own edification):

1. Where is it documented in the HP/Compaq docs on why this works this way (i.e. the ALT key working).

2. What is in the operating system that recognized the key bindings ALT-F1, etc. (i.e. xev saw SHIFT-F1 as F11, but not DECterm, where as DECterm saw ALT-F1 as F11, but xev saw ALT-F1 as ALT and F1 pressed).

Again, thanks for all the help and suggestions.