[comp.windows.x] Specifying return in trans-table?

Image.Data@TOAST.MAPS.CS.CMU.EDU (06/14/89)

Has anyone been able to specify the return key in the translation
table of a widget?

I'm trying to change the way an asciiText widget responds to the
return key (normally just a newline) by overriding the default
translations with :

"<Key>Return:	my_routine() "

The XtParseTranslations routine seems to think this is the same as :

"<Key>R:	my_routine() "

In the Athena Widgets documentation (pg. 21 in mine), for Text widgets,
the defaultTextTranslation string specifies the return key to preform
the newline() function like this :

"<Key>Return:	newline() "

How come when I do it it doesn't work?

Any help would be appreciated.

converse@EXPO.LCS.MIT.EDU (Donna Converse) (06/14/89)

> Has anyone been able to specify the return key in the translation
> table of a widget?

Yes, I've had success in an application defaults file; here's an excerpt:

XCalc.hp.bevel.screen.LCD.translations: #replace\n\
                                <Key>Return:enter()\n

> How come when I do it it doesn't work?

I don't know.  If you can pare the problem down to a short example program,
I'll take the time to investigate.

Donna Converse
converse@expo.lcs.mit.edu

swick@ATHENA.MIT.EDU (Ralph R. Swick) (06/16/89)

> "<Key>Return:	newline() "
>
> How come when I do it it doesn't work?

If you have an X11R3 implementation of Xt then it should; if you
have an earlier implementation then it won't.  Caution: even with
an R3 implementation, if you mis-spell the keysym name you won't
get told about it.

If your implementation is pre-R3, you can achieve the desired
effect by specifying the hexadecimal encoding of the keysym;
e.g. in the case of XK_Return, specify 0xFF0D as the detail field.

dpb@mozart.UUCP (Don Bennett) (06/16/89)

> If you have an X11R3 implementation of Xt then it should; if you
> have an earlier implementation then it won't.  Caution: even with
> an R3 implementation, if you mis-spell the keysym name you won't
> get told about it.

How about R4?

   Don Bennett           (408)433-3311
   dpb@frame.com
   Frame Technology

meo@stiatl.UUCP (Miles O'Neal) (06/21/89)

In article <3552@frame.UUCP> dpb@mozart.UUCP (Don Bennett) writes:
| > an R3 implementation, if you mis-spell the keysym name you won't
| > get told about it.
| How about R4?

Hey, Don, send me a copy of your R4, and I'll let you know.
All the R4 I have doesn't do anything yet!

8^)

Tacos,
Miles