10 static int initialised=0;
14 extern ggi_visual_t *screenvis;
18 extern void keyboard_handler(int key, ubyte state);
19 extern void mouse_handler_button(int button, ubyte state);
20 extern void mouse_handler_relative(int x, int y);
21 extern void mouse_handler_absolute(int x, int y);
33 // Error("GII error: no inputs (perhaps you need to set GII_INPUT env var)\n");
38 giiEventPoll(inputs, emAll, &tv);
40 n = giiEventsQueued(inputs, emAll);
44 giiEventRead(inputs, &event, emAll);
45 switch (event.any.type)
48 keyboard_handler(event.key.label, 1);
51 keyboard_handler(event.key.label, 0);
54 mouse_handler_absolute(event.pmove.x, event.pmove.y);
57 mouse_handler_relative(event.pmove.x, event.pmove.y);
59 case evPtrButtonPress:
60 mouse_handler_button(event.pbutton.button, 1);
62 case evPtrButtonRelease:
63 mouse_handler_button(event.pbutton.button, 0);
77 int gii_xwin_initialized=0;
78 #include <ggi/input/xwin.h>
79 //void lock_nothing(void){return;}
80 void init_gii_xwin(Display *disp,Window win){
81 printf("gii xwin %i %i\n",initialised,gii_xwin_initialized);
84 if (gii_xwin_initialized){
86 gii_xwin_cmddata_setparam *giiargs=(gii_xwin_cmddata_setparam *) &ev.cmd.data;
87 memset(&ev,0,sizeof(gii_cmd_nodata_event)+sizeof(gii_xwin_cmddata_setparam));
88 ev.cmd.code=GII_CMDCODE_XWINSETPARAM;
89 ev.any.type = evCommand;
90 ev.any.size=sizeof(gii_cmd_nodata_event)+sizeof(gii_xwin_cmddata_setparam);
92 giiargs->ptralwaysrel=1;
93 giiEventSend(inputs,&ev);
96 gii_inputxwin_arg giiargs;
97 memset(&giiargs,0,sizeof(giiargs));
100 giiargs.ptralwaysrel=1;
101 //giiargs.gglock=lock_nothing;
102 inputs2=giiOpen("xwin",&giiargs,NULL);
104 gii_xwin_initialized=1;
106 inputs=giiJoinInputs(inputs,inputs2);
119 inputs = ggiJoinInputs(screenvis, NULL);
121 inputs=giiOpen(NULL);