By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,122 Members | 1,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,122 IT Pros & Developers. It's quick & easy.

Gii problem

P: n/a
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

Dec 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

step wrote:
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
Probably someone can, but you almost certainly won't get a good
response to this question in this group. This is a group about the C
language, not specific packages even if they are written and/or
exploited with C.

<OT>
I'd start by going back to the place from which I got GII and asking
there (a quick google got me to
http://www.ggi-project.org/contact.html), or looking for a more
suitable news group, for example one of the linux groups.
</OT>

Dec 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.