Operating System - HP-UX
1833110 Members
3299 Online
110051 Solutions
New Discussion

Re: Using a non-standard keyboard

 
SOLVED
Go to solution
Richard Munn
Frequent Advisor

Using a non-standard keyboard

Does anyone know how to remap keycodes from a non-standard keyboard in HP-UX 11.11?

We have several systems, OpenVMS, Tru64 UNIX and HP-UX. These are generally connected via a switchbox (BlackBox ServSwitch). The standard keyboard is the VMS layout keyboard (LK463). We are currently using the new HP USB LK463???s. The Tru64 boxes understand the LK463 provided you tell the kernel what type of KB it is using. The VMS KB has slightly different key mappings (like the ??? key has the + key code as far as HP-UX is concerned) but these are probably not that hard to remap inside X11. But the extended functions keys: F17-F20, Help & Do are a problem. Using xev to show X events, I see that all of these keys return keycode 09 so I can???t simply remap them. I don???t know what keycode 09 is, maybe a generic ???undefined??? (???). This would seem to imply that something at a lot lower level needs to know what the keyboard is doing. The Tru64 boxes do use the extended keys (at least F17-F20) and the point here is that these are progressively being replaced with HP-UX boxes. It is not an option to remove the F17-F20 functionality from the operators, there are to many SOP???s that depend upon them.

Can anyone suggest where I can start on this? Is there a keyboard driver that maps scan codes to keycodes that can be changed? If Tru64 UNIX can interpret these codes then there should also be a way to get HP-UX to do the same. I???ve tried to work out how keyboards interface to the system but there seems to be a jungle of things that map things at various points ??? it???s not at all clear to me how this all works.
5 REPLIES 5
Steve Steel
Honored Contributor

Re: Using a non-standard keyboard

Hi


1) Look at man xmodmap


2) www.docs.hp.com

Search

using the X window system


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
twang
Honored Contributor

Re: Using a non-standard keyboard

Richard Munn
Frequent Advisor

Re: Using a non-standard keyboard

Been there.

xmodmap is the obvious way to correct the -/+ key swap but it does not help with the extended keys. As I said all the extended keys return a keycode of 9. Xmodmap does not accept keycodes less than 16 and even if it could with every key returning 9 how would you seperate them. There must be something much lower down that is generating the keycode of 9 and it does not know what to do with the extra keys on the keyboard.
Mike Stroyan
Honored Contributor
Solution

Re: Using a non-standard keyboard

This could be very hard.

The keycode to keysym mapping is relatively easy.
You can use /usr/contrib/bin/X11/keymap_ed to create a new keyboard name and mapping.
List existing mappings with
keymap_ed -l
Dump a similiar mapping with
keymap_ed -d USB_PS2_DIN_US_English > LK463
Edit that file to change the name and keys.
Add a new mapping with
keymap_ed -s LK463
Edit /etc/kbdlang or run itemap to set new map.

The matter of duplicate keycode values is going to be hard. The keycodes are mapped by an X server "driver", which is really a shared library loaded by the X server. The mapping is normally rather simple.
It sounds like the LK463 keyboard is sending a very different byte sequence than the driver expects. You can see how the driver works by studying the source code available at
http://ftp.x.org/pub/R6.4/xc/programs/Xserver/hw/hp/input/drivers/
It may be possible to build the hp7lc2k.c file there and use it in place of the standard /usr/lib/X11/extensions/hp7lc2k.1 shared library. With a replacement driver, you may be able to figure out what your keyboard really sends for those keys and map that to distinct keycodes. (The USB devices look like ps2 devices to the X server. So, look at "man ps2" for details of the device file and ioctls.)


Richard Munn
Frequent Advisor

Re: Using a non-standard keyboard

Thisis good at least I now know where the keycodes can be manipulated. All I have to do is build an environment to be able to compile the shared libary and try my own mappings.

Thanks...