[PD-cvs] externals/hcs linuxmouse.c,1.5,1.6
Hans-Christoph Steiner
eighthave at users.sourceforge.net
Sun May 30 03:59:08 CEST 2004
Update of /cvsroot/pure-data/externals/hcs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23011
Modified Files:
linuxmouse.c
Log Message:
fixed bug where closing and opening the device would reset it to the default regardless of what was specified
Index: linuxmouse.c
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/linuxmouse.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** linuxmouse.c 28 May 2004 01:03:21 -0000 1.5
--- linuxmouse.c 30 May 2004 01:59:05 -0000 1.6
***************
*** 70,85 ****
linuxmouse_close(x);
-
- /* For some reason, not initializing x->x_devname causes a seg fault */
- /* on this object, but it works fine on [linuxevent] */
- t_symbol *temp = malloc(20);
- temp->s_name = "/dev/input/event0";
- x->x_devname = temp;
! /* set obj device name to parameter
! * otherwise set to default
! */
! if (s != &s_) x->x_devname = s;
!
#ifdef __gnu_linux__
/* open device */
--- 70,78 ----
linuxmouse_close(x);
! /* set obj device name to parameter otherwise set to default */
! if ( s != &s_ )
! x->x_devname = s;
!
#ifdef __gnu_linux__
/* open device */
***************
*** 210,213 ****
--- 203,210 ----
DEBUG(post("linuxmouse_start"););
+ /* if the device isn't open already, open it */
+ /* (I'll test this later -HCS) */
+ /* if (x->x_fd < 0) linuxmouse_open(x,&s_); */
+
#ifdef __gnu_linux__
if (x->x_fd >= 0 && !x->x_started) {
***************
*** 247,251 ****
x->x_read_ok = 1;
x->x_started = 0;
!
/* create outlets for each axis */
for (i = 0; i < LINUXMOUSE_AXES; i++)
--- 244,249 ----
x->x_read_ok = 1;
x->x_started = 0;
! x->x_devname = gensym("/dev/input/event0");
!
/* create outlets for each axis */
for (i = 0; i < LINUXMOUSE_AXES; i++)
More information about the Pd-cvs
mailing list