[gpm] gpm_open fails
Rod Berriman
rod@optimail.com.au
Tue Mar 11 05:03:59 CET 2008
Amaresh,
1: I'm not clear what you mean by "invalid argument" error code.
Your code only tests for return of -1, cannot connect:
if(Gpm_Open(&conn, 0) == -1) ...
Have you got some other code looking for other errors?
What is the numeric value of the return code?
2: Is the mouse type the same on both systems?
Maybe exps2 is not appropriate on the other system.
3: Are you running xterm on one system, and console terminal on another?
return value of -2 is not an error, but an indication of xterm.
regards,
Rodney
Amaresh wrote:
Hi,
I am trying to receive mouse event using libgpm library. I have run the GPM
server as
%gpm -m /dev/input/mice -t exps2
The I am trying to open connection with GPM Server using Gpm_open function.
Gpm_open always fails with invalid argument as error code.
Code Snippets:
/****************************************************************************************************/
#include <stdio.h>
#include <gpm.h>
int my_handler(Gpm_Event *event, void *data)
{ printf("Event Type : %d at x=%d y=%d\n", event->type, event->x,
event->y);
return 0;
}
int main()
{ Gpm_Connect conn;
int c;
conn.eventMask = ~0; /* Want to know about all the events */
conn.defaultMask = 0; /* don't handle anything by default */
conn.minMod = 0; /* want everything */
conn.maxMod = ~0; /* all modifiers included */
if(Gpm_Open(&conn, 0) == -1)
{
perror("Cannot connect to mouse server\n");
return 0;
}
gpm_handler = my_handler;
while((c = Gpm_Getc(stdin)) != EOF)
printf("%c", c);
Gpm_Close();
return 0;
}
/****************************************************************************************************/
I am using GPM version 1.19.6. The above code is working on one of my
server but throwing error on another.
Can some one help me to resolve the issues?
More information about the gpm
mailing list