Gii problem
- From: "step" <fxlzju@xxxxxxxxx>
- Date: 22 Dec 2006 03:13:39 -0800
hi
anybody use gii?
now i just install gii lib,and i run the demo which is gii provide,
it can't run correctly,
my system is debian ,kernel 2.6
i also write a test code
#include <ggi/gii.h>
#include <ggi/events.h>
#include <stdio.h>
#include <stdlib.h>
int main(int args,char **argv)
{
int rc;
rc=giiInit();
if(rc<0)
{
printf("GiiInit Error");
exit(1);
}
gii_input_t inp;
inp=giiOpen("linux-evdev");
if(!inp)
{
printf("can't open inp input");
giiExit();
exit(1);
}
int n;
gii_event ev;
for (;;) {
struct timeval tv = { 0, 100 };
giiEventPoll(inp, emAll, &tv);
//n = giiEventsQueued(inp, emAll);
//if (n == 0) break;
// while (n--) {
giiEventRead(inp, &ev, emAll);
switch(ev.any.type)
{
case evKeyPress:
printf("KeyPress ");goto showkey;
showkey:
printf("sym=%4d label=%4c button=%4d\n",
ev.key.sym,ev.key.label,ev.key.button);
break;
case evPtrAbsolute:
printf("PtrAbsolute ");goto showptr;
case evPtrRelative:
printf("PtrRelative ");
showptr:
printf("mouse x=%4x y=%4x z=%4x w=%4x\n",
ev.pmove.x,ev.pmove.y,ev.pmove.z,ev.pmove.wheel);
break;
//default:
// printf("event: type=%d\n",ev.any.type);
//printf("\n");
}
//}
}
giiClose(inp);
giiExit();
return 0;
}
and i export GII_INPUT=linux-evdev:/dev/input/event0. when i run it
,it can only konw key event,it can't listen the mice event ,my mice use
usb port.
somebody can help me? 3x
.
- Prev by Date: Re: problem while detecting floating point operations
- Next by Date: Re: crontab
- Previous by thread: Re: does anybody know an very old technology called BBS and how to program BBS?
- Next by thread: GDB capabilities for exploring STL classes
- Index(es):