3 * GGI Event related stuff
20 static int initialised=0;
24 extern ggi_visual_t *screenvis;
28 extern void keyboard_handler(int key, ubyte state);
29 extern void mouse_handler_button(int button, ubyte state);
30 extern void mouse_handler_relative(int x, int y);
31 extern void mouse_handler_absolute(int x, int y);
43 // Error("GII error: no inputs (perhaps you need to set GII_INPUT env var)\n");
48 giiEventPoll(inputs, emAll, &tv);
50 n = giiEventsQueued(inputs, emAll);
54 giiEventRead(inputs, &event, emAll);
55 switch (event.any.type)
58 keyboard_handler(event.key.label, 1);
61 keyboard_handler(event.key.label, 0);
64 mouse_handler_absolute(event.pmove.x, event.pmove.y);
67 mouse_handler_relative(event.pmove.x, event.pmove.y);
69 case evPtrButtonPress:
70 mouse_handler_button(event.pbutton.button - 1, 1);
72 case evPtrButtonRelease:
73 mouse_handler_button(event.pbutton.button - 1, 0);
89 int gii_xwin_initialized=0;
90 #include <ggi/input/xwin.h>
91 //void lock_nothing(void){return;}
92 void init_gii_xwin(Display *disp,Window win){
93 printf("gii xwin %i %i\n",initialised,gii_xwin_initialized);
96 if (gii_xwin_initialized){
98 gii_xwin_cmddata_setparam *giiargs=(gii_xwin_cmddata_setparam *) &ev.cmd.data;
99 memset(&ev,0,sizeof(gii_cmd_nodata_event)+sizeof(gii_xwin_cmddata_setparam));
100 ev.cmd.code=GII_CMDCODE_XWINSETPARAM;
101 ev.any.type = evCommand;
102 ev.any.size=sizeof(gii_cmd_nodata_event)+sizeof(gii_xwin_cmddata_setparam);
104 giiargs->ptralwaysrel=1;
105 giiEventSend(inputs,&ev);
108 gii_inputxwin_arg giiargs;
109 memset(&giiargs,0,sizeof(giiargs));
112 giiargs.ptralwaysrel=1;
113 //giiargs.gglock=lock_nothing;
114 inputs2=giiOpen("xwin",&giiargs,NULL);
116 gii_xwin_initialized=1;
118 inputs=giiJoinInputs(inputs,inputs2);
131 inputs = ggiJoinInputs(screenvis, NULL);
133 inputs=giiOpen(NULL);