hi:
now i just install gii lib,and i run the demo which is
gii provide(inputinfo mhub ...),
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=%4dn",
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=%4xn",
ev.pmove.x,ev.pmove.y,ev.pmove.z,ev.pmove.wheel);
break;
//default:
// printf("event:
type=%dn",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
--
方旭亮
#
# 浙江杭州浙江大学玉泉校区1455信箱工程与科学计算中心
# MSN:fxlzju gmail.com
# My Blog: http://fxl.blogbus.com
#
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief surveys -
and earn cash
http://www.techsay.com/default.php?page=join
.php&p=sourceforge&CID=DEVDEV_______________________
________________________
ggi-users mailing list
ggi-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ggi-users
|