13 static int initialised=0;
17 extern ggi_visual_t *screenvis;
21 extern void keyboard_handler(int key, ubyte state);
22 extern void mouse_handler_button(int button, ubyte state);
23 extern void mouse_handler_relative(int x, int y);
24 extern void mouse_handler_absolute(int x, int y);
36 // Error("GII error: no inputs (perhaps you need to set GII_INPUT env var)\n");
41 giiEventPoll(inputs, emAll, &tv);
43 n = giiEventsQueued(inputs, emAll);
47 giiEventRead(inputs, &event, emAll);
48 switch (event.any.type)
51 keyboard_handler(event.key.label, 1);
54 keyboard_handler(event.key.label, 0);
57 mouse_handler_absolute(event.pmove.x, event.pmove.y);
60 mouse_handler_relative(event.pmove.x, event.pmove.y);
62 case evPtrButtonPress:
63 mouse_handler_button(event.pbutton.button - 1, 1);
65 case evPtrButtonRelease:
66 mouse_handler_button(event.pbutton.button - 1, 0);
82 int gii_xwin_initialized=0;
83 #include <ggi/input/xwin.h>
84 //void lock_nothing(void){return;}
85 void init_gii_xwin(Display *disp,Window win){
86 printf("gii xwin %i %i\n",initialised,gii_xwin_initialized);
89 if (gii_xwin_initialized){
91 gii_xwin_cmddata_setparam *giiargs=(gii_xwin_cmddata_setparam *) &ev.cmd.data;
92 memset(&ev,0,sizeof(gii_cmd_nodata_event)+sizeof(gii_xwin_cmddata_setparam));
93 ev.cmd.code=GII_CMDCODE_XWINSETPARAM;
94 ev.any.type = evCommand;
95 ev.any.size=sizeof(gii_cmd_nodata_event)+sizeof(gii_xwin_cmddata_setparam);
97 giiargs->ptralwaysrel=1;
98 giiEventSend(inputs,&ev);
101 gii_inputxwin_arg giiargs;
102 memset(&giiargs,0,sizeof(giiargs));
105 giiargs.ptralwaysrel=1;
106 //giiargs.gglock=lock_nothing;
107 inputs2=giiOpen("xwin",&giiargs,NULL);
109 gii_xwin_initialized=1;
111 inputs=giiJoinInputs(inputs,inputs2);
124 inputs = ggiJoinInputs(screenvis, NULL);
126 inputs=giiOpen(NULL);
134 #endif /* GII_INPUT */