HDS ViewStation System Administrator's Guide

A Hypertext Document


X Keymapping Tools

This page describes some tools useful in analyzing and changing the keymapping for the keyboard and mouse.

Keymap Methods and Tools
When the ViewStation starts, it queries the keyboard for its type and the keyboard replies with an identifier code. The ViewStation then matches this code to a table of keycodes appropriate to that keyboard. This is the server's xmodmap file and matches keycodes with keysyms.

Xmodmap Table
This table shows the keycode (sent from the keyboard to the ViewStation) and its assigned keysym (a character or function) in a tabular form. This table can be seen with the xmodmap command:

xmodmap -pk (this prints the keymap table)
xmodmap -pm (this prints the modifier table)
xmodmap -pp (this prints the pointer table)

Look at these files to get an idea of these mapping assignments. Refer also to the xmodmap man pages for more details. Note that xmodmap is also a ViewStation local client, so man pages are available from the ViewStation directory.

Xev Key Monitoring
You can use the Xev (X Event) utility program (this is a standard X client) to see what keycodes and keysyms are actually being transmitted. When you start Xev, place the cursor in the event box, and then press a key, or move the mouse, etc. You will see the event logged on your screen with a lot of information about the event. In this case, the keycode, the modifiers' state, and the keysym. This helps you analyze what is being sent and how the assignments are made.

This is a sample Xev event that reports the sequence <Press Shift_L>, <Press a>, <Release a>, <Release Shift_L>, which produces "A":

KeyPress event, serial 15, synthetic NO, window 0x3800001,
root 0x29, subw 0x3800002, time 95819540, (47,49), root:(112,135),
state 0x0, keycode 174 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 characters: ""

KeyPress event, serial 15, synthetic NO, window 0x3800001,
root 0x29, subw 0x3800002, time 95821980, (47,49), root:(112,135),
state 0x1, keycode 194 (keysym 0x41, A), same_screen YES,
XLookupString gives 1 characters: "A"

KeyRelease event, serial 15, synthetic NO, window 0x3800001,
root 0x29, subw 0x3800002, time 95822180, (47,49), root:(112,135),
state 0x1, keycode 194 (keysym 0x41, A), same_screen YES,
XLookupString gives 1 characters: "A"

KeyRelease event, serial 15, synthetic NO, window 0x3800001,
root 0x29, subw 0x3800002, time 95823630, (47,49), root:(112,135),
state 0x1, keycode 174 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 characters: ""


Note the keycode and keysym information. The "state" refers to the state of the modifier keys (Shift = 1, Ctrl = 2, Alt = 4, and so on). The XLookupString interprets the keysym for you.

Use this tool to analyze what keysym the ViewStation is producing. You can then determine whether you want to change the keysym or redefine its action with an event translation resource.

Return to Section Heading Page


Return to the Home Page

If you need more information than is available here, you can reach HDS via email at info@hds.com, or call us at 1.800.HDS.1551 in the USA, or at +610.277.8300 from outside the US. For questions or problems regarding the HDS WWW page, contact webmaster@hds.com.
© 1996 by HDS Network Systems Inc.