Path: utzoo!utgpu!watmath!watcgl!watnext!jmberkley From: jmberkley@watnext.waterloo.edu (J. Michael Berkley) Newsgroups: comp.windows.x Subject: Re: Binding keypad enter to an action (in the toolkit) Message-ID: <8369@watcgl.waterloo.edu> Date: 1 Mar 89 20:08:03 GMT References: <3447@stiatl.UUCP> Sender: daemon@watcgl.waterloo.edu Reply-To: jmberkley@watnext.waterloo.edu (J. Michael Berkley) Organization: U. of Waterloo, Ontario Lines: 48 In article <3447@stiatl.UUCP> meo@stiatl.UUCP (Miles O'Neal) writes: >In article <8321@watcgl.waterloo.edu> jmberkley@watnext.waterloo.edu (J. Michael Berkley) writes: >>Using C and the toolkit, how can you add the keypad enter key to the >>translation table. I can do it as a resource using xrdb, but I can't >>find a way to do it from a C program. > >You didn't mention your hardware, but I know our Roadrunners are set >up like this. We set things up via xmodmap because we are using a version >of the server someone else has tweaked, but know what we need to change >when we start supporting our server. Look in the server/ddx/ >directory at the KeyMap.c file. No, that's not it. In lib/Xaw/TextTr.c there are entries for Key translations: char defaultTextTranslations[] = "\ . . Right: forward-character() \n\ . . "; In my code, I tried: XtOverrideTranslations(w, XtParseTranslationTable("KB_Enter: print-selection()")); The "KB_Enter" comes from lib/X/ks_names.h. This piece of C code does not work. This does work with other keys, eg. "metaS". In my .Xresources file, I can say: stuff*Text.Translations: #override \ KP_Enter: print-selection() This does do the correct translation binding, but of course I don't want all of my users to have to add this to their .Xresources file. ****************************************** * Mike Berkley, University of Waterloo * * PAMI Lab * * jmberkley@watnext.waterloo.edu * * jmberkley@watnext.UWaterloo.CA * * {utai,uunet}!watmath!watnext!jmberkley * ******************************************