Subject: KeyPressActions in LessTif
To: None <netbsd-help@netbsd.org>
From: Jochen Schmidt <crashcore@t-online.de>
List: netbsd-help
Date: 07/26/1998 21:25:43
Hello,
Does anyone know why the KeyPressActions, that work perfectly with
Xaw don`t work with LessTif (i`m using LessTif 0.85.3)
I`ve tired following code:
#include <iostream.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/keysym.h"
#include <Xm/Xm.h>
Widget w_parent;
XtAppContext app_context;
void KeyTestAction(Widget w,XEvent* event,String* params, Cardinal*
num_params)
{
char buffer[20];
KeySym key;
XLookupString((XKeyEvent*)event,buffer,20,&key,NULL);
cout << "KeyPressEvent: " << (unsigned long)key << endl;
}
static XtActionsRec Test_Actions[] = {
{"KeyTest",KeyTestAction}
};
int main(int argc,char** argv)
{
w_parent =XtVaAppInitialize(
&app_context,
"XTest",
NULL,0,
&argc,argv,
NULL,NULL);
XtRegisterGrabAction(
KeyTestAction,
KeyPressMask|KeyReleaseMask,
True,
GrabModeAsync,
GrabModeAsync,
XtAppAddActions(app_context,Test_Actions,1);
XtRealizeWidget(w_parent);
XtAppMainLoop(app_context);
}
---------------------------------
! Resources
XTest.width: 320
XTest.height: 200
XTest.translations: <Key>Up: KeyTest()
Regards,
Jochen Schmidt
crashcore@t-online.de