[comp.windows.x] Virtual binding loses original key

paul@tredysvr.Tredydev.Unisys.COM (Paul Siu) (01/08/91)

The problems I posted about being unable to translate certain keys have been
trace down virtual binding.  I thank you all the netters who send me advise.

The X-system binds a keysym to the keycode.  A keysym represent the symbol on
the cap of the keys, while the keycode represent the code generated when the
key is pressed.  The keysym that binds directly to the keycode is call the
actual keysym.

Motif adds another layer of abstraction by binding a virtual keysym to an
actual keysym.  "osfHelp" for example, is often bind to the keysym "F1".  This
allow user to customize keys responses to his or her liking, it also allow the
use of non-standard keyboard, in case for example if the keyboard does not have
a "F1" key.

The problem with virtual binding is the lost of the actual keysym.  Motif
stores a number of default bindings, "osfHelp" is binded to "F1".
While you can reference "osfHelp" in your translation entries, you cannot do
the same with "F1".  In any case, the following translation works:

App*widget.translations:   #override\n\
   <Key>osfHelp:   action()

The following translation does not work, even though "osfHelp" is bind to "F1":

App*widget.translations:   #override\n\
   <Key>F1:        action()

My question is what do I have to do to reference "F1" in the translation?  I
have try rebinding F1 to F1, but it resulted in very strange keyboard behavior.
Binding "F1" to "osfHelp" is out of the question, so is just using "osfHelp" as
substitue for "F1", since "osfHelp" may be rebind to something else by the
user.

I thank you for any response.

Paul Siu
paul@tredysvr.tredydev.unisys.com