[comp.windows.x] Can't Override Translation

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

I am trying to customize a widget using the translation table.  A number of
keys refused to be change though.  Let's say I want the F2 key to set off
the button "btn", I can add this to my application resource file.

*btn.translations:     #override\n\
   <Key>F2:        ArmAndActivate()\n\

This works fine for the key "F2".  When I press F2, the button is armed,
and activated.  When I try to use "F1" or "Delete", or "BackSpace", it
doesn't work.  Why?

I am running Motif 1.1, under X11R4.  I thank you for any response.


Paul Siu
paul@tredysvr.tredydev.unisys.com

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (01/04/91)

I apologize for my vague wording.
I meant that when one of our X hackers seemed
to find that when she compiled and built an
Andrew Toolkit application that the application
actually tried to initiate a connection for
somehting other than X.

This is equivalent to trying to rlogin into
an X terminal which, of course, makes no sense
since the X terminal does not accept connections
for anything non-X related.

I have been told that this does not happen.  We
will get somebody else to try it ....
--
					Eric Taylor
					Baylor College of Medicine
					etaylor@wilkins.bcm.tmc.edu
					(713) 798-3776

dce@smsc.sony.com (David Elliott) (01/05/91)

In article <1113@tredysvr.Tredydev.Unisys.COM>, paul@tredysvr.Tredydev.Unisys.COM (Paul Siu) writes:
|> I am trying to customize a widget using the translation table.  A number of
|> keys refused to be change though.  Let's say I want the F2 key to set off
|> the button "btn", I can add this to my application resource file.
|> 
|> *btn.translations:     #override\n\
|>    <Key>F2:        ArmAndActivate()\n\
|> 
|> This works fine for the key "F2".  When I press F2, the button is armed,
|> and activated.  When I try to use "F1" or "Delete", or "BackSpace", it
|> doesn't work.  Why?

I'm a little confused.

Are you saying that if you change the above to

*btn.translations:     #override\n\
    <Key>Delete:        ArmAndActivate()\n\

it doesn't arm and activate the button, or are you saying that after
adding the above translations that the exsiting translations for F1,
Delete, and BackSpace no longer work?

Also, is this a customization via your .Xdefaults, or via the
application's app-defaults file?  If .Xdefaults, does the application
already have "*btn" translations?

--
...David Elliott
...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
...(408)944-4073
..."That's *Mr.* Squishy-Lips to you!"

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

In article <1991Jan4.160401.21666@smsc.sony.com> dce@smsc.sony.com (David Elliott) writes:
>I'm a little confused.
>
>Are you saying that if you change the above to
>
>*btn.translations:     #override\n\
>    <Key>Delete:        ArmAndActivate()\n\
>
>it doesn't arm and activate the button, or are you saying that after
>adding the above translations that the exsiting translations for F1,
>Delete, and BackSpace no longer work?
>
>Also, is this a customization via your .Xdefaults, or via the
>application's app-defaults file?  If .Xdefaults, does the application
>already have "*btn" translations?

I am saying that when certain keys, notably F1, F4, F10, Escape, the arrow
keys, the delete, and the backspace key does not response to entries in the
translation no matter what you do.  Other keys such as F2, F3, etc works fine
as long as I enter the translation correctly.

I put the translation in the resource file, namely the application resource
file in /usr/lib/X11/app-defaults/.  I also try putting the translation in
the .Xdefaults, and in program code, and it still does not work.

I am investigating keymapping, perhaps it is not mapped correctly.

I am still open to suggestions.  Thanks.

Paul Siu
paul@tredysvr.tredydev.unisys.com

gildea@expo.lcs.mit.EDU (Stephen Gildea) (01/08/91)

Motif defines some "virtual keysyms," and you may have to use them.
Try using the keysym osfDelete ('though I agree Delete should work).

 < Stephen

ben@hpcvlx.cv.hp.com (Benjamin Ellsworth) (01/08/91)

Motif pushbuttons do some ahh... interesting things with translations
in a dynamic fashion.  These things are done to support and enforce the
style guide.  F1, <esc>, and friends have specific meaning for
pushbuttons.  Trying to change that meaning is not well supported by
the default (i.e. distributed) widget set.

-----------------------------------------------------------------------
Benjamin Ellsworth      | ben@cv.hp.com                | INTERNET
Hewlett-Packard Company | {backbone}!hplabs!hp-pcd!ben | UUCP
1000 N.E. Circle        | (USA) (503) 750-4980         | FAX
Corvallis, OR 97330     | (USA) (503) 757-2000         | VOICE
-----------------------------------------------------------------------
                     All relevant disclaimers apply.
-----------------------------------------------------------------------