Consultor Eletrônico



Kbase 15977: How to remap number pad on keyboard to transmit numbers only
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
How to remap number pad on keyboard to transmit numbers only

This kbase is designed to assist customers that are trying to remap
their numeric keypad to transmit only numbers when in Motif. The
number pad typically has multiple functions - arrows, Home, End as
well as Pg Up, Pg Down, also the various numbers from 0 - 9.

Customers that deal with numbers tend to prefer not to be required
to enable the NumLock for data entry into an application. The NumLock
key can change the behavior of other keys on the keyboard from a
Motif standpoint. The reason is that keys on a keyboard can contain
multiple functions depending upon which meta or modifier key prefaces
the actual key press.

In Motif to see your keyboard definitions, you can type:
xmodmap -pk >xmodmap.out

When you review the information in the xmodmap.out file you created
above, you will see what your keys are, what their KeyCode (the code
assigned to key placement on the keyboard) KeySym Value (hex value
sent when the key is pressed) Keysym Name (Name of the physical key
and the name of the key or function when associated with a Control,
Shift or other modifier, like NumLock etc....).

In order to remap the keys you would use the xmodmap command. You
can place these lines of text in either the users .profile, .login
or any other file user may utilize to enable Motif on their machine,
When you use the xmodmap command to remap keys, they remain in effect
throughout the Motif session for all clients. In other words, when
you remap the number pad as we will do in this kbase, your number pad
will transmit numbers regardless of if you press the NumLock key or
not. Also, it means that you will no longer be able to use the arrow
keys or other shifted functions like Pg Up, Home etc... that appear
on the number pad. You will need to use your alternate keys to
perform those functions. The other note to keep in mind is that your
number pad will now react this way regardless of what application you
are running. Therefore, vi, mail and progress will all transmit
numbers when pressing one of the number keys on the number pad.

Command syntax:

xmodmap -e "keysym KP_1 = 1"
xmodmap -e "keysym KP_2 = 2"
xmodmap -e "keysym KP_3 = 3"
xmodmap -e "keysym KP_4 = 4"
xmodmap -e "keysym KP_5 = 5"
xmodmap -e "keysym KP_6 = 6"
xmodmap -e "keysym KP_7 = 7"
xmodmap -e "keysym KP_8 = 8"
xmodmap -e "keysym KP_9 = 9"
xmodmap -e "keysym KP_0 = 0"
xmodmap -e "keysym KP_Decimal = ."

If you are interested in additional information on xmodmap. please
reference your Operating System Manuals on Xwindows or Motif. You
can also make use of man pages for the command xmodmap. With xmodmap
you can remap keys based on the KeyCode, Keysym Value or Keysym Name.

July, 1996
CAO

Progress Software Technical Support Note # 15977