Duplicate mouse events

A recent revision in SVN fixes an old bug that caused any CorePointer
X11 device to be missed when enumerating pointer devices. Now it’s
working, but now I’m getting duplicate mouse events for everything.
Like this:

donny at teamspace:~/SDL/test$ ./testmmousetablet
Initing…
5 pointing devices found
device index: 0 name:CorePointer
device index: 1 name:microsoft_intellimouse
device index: 2 name:wacom_mouse
device index: 3 name:wacom_eraser
device index: 4 name:wacom_stylus_pen_tip
Device id: 1 x: 639 y: 460 relx: 639 rely: 460 pressure: 0
pressure_max: 0 pressure_min:
0 current cursor:0
Device id: 0 x: 621 y: 430 relx: 621 rely: 430 pressure: 0
pressure_max: 0 pressure_min:
0 current cursor:0
Device id: 1 x: 621 y: 430 relx: -18 rely: -30 pressure: 0
pressure_max: 0 pressure_min:
0 current cursor:0
Device id: 0 x: 609 y: 402 relx: -12 rely: -28 pressure: 0
pressure_max: 0 pressure_min:
0 current cursor:0

Previously “CorePointer” didn’t show up in the list, and now it does,
which is probably a good thing, but I think receiving mouse events
like this is not. I think the “which” field of pointer events should
possibly become a bit mask rather than an index. That would allow you
to consolidate the events into singular events – but they really
aren’t singular events, and there are legitimate needs to get data
from them independently over each other.

This seems like a very messy situation… I think CorePointer needs
special treatment.–
http://codebad.com/

Just for clarity, I tested revision 4293 against revision 4294 and
that is where the critical change happens (although I’m sure Sam would
have known that without even checking.)On Fri, Jan 2, 2009 at 3:43 PM, Donny Viszneki <@Donny_Viszneki> wrote:

A recent revision in SVN fixes an old bug that caused any CorePointer
X11 device to be missed when enumerating pointer devices. Now it’s
working, but now I’m getting duplicate mouse events for everything.
Like this:

donny at teamspace:~/SDL/test$ ./testmmousetablet
Initing…
5 pointing devices found
device index: 0 name:CorePointer
device index: 1 name:microsoft_intellimouse
device index: 2 name:wacom_mouse
device index: 3 name:wacom_eraser
device index: 4 name:wacom_stylus_pen_tip
Device id: 1 x: 639 y: 460 relx: 639 rely: 460 pressure: 0
pressure_max: 0 pressure_min:
0 current cursor:0
Device id: 0 x: 621 y: 430 relx: 621 rely: 430 pressure: 0
pressure_max: 0 pressure_min:
0 current cursor:0
Device id: 1 x: 621 y: 430 relx: -18 rely: -30 pressure: 0
pressure_max: 0 pressure_min:
0 current cursor:0
Device id: 0 x: 609 y: 402 relx: -12 rely: -28 pressure: 0
pressure_max: 0 pressure_min:
0 current cursor:0

Previously “CorePointer” didn’t show up in the list, and now it does,
which is probably a good thing, but I think receiving mouse events
like this is not. I think the “which” field of pointer events should
possibly become a bit mask rather than an index. That would allow you
to consolidate the events into singular events – but they really
aren’t singular events, and there are legitimate needs to get data
from them independently over each other.

This seems like a very messy situation… I think CorePointer needs
special treatment.


http://codebad.com/


http://codebad.com/

Previously “CorePointer” didn’t show up in the list, and now it does,
which is probably a good thing, but I think receiving mouse events
like this is not. I think the “which” field of pointer events should
possibly become a bit mask rather than an index. That would allow you
to consolidate the events into singular events – but they really
aren’t singular events, and there are legitimate needs to get data
from them independently over each other.

This seems like a very messy situation… I think CorePointer needs
special treatment.

Author: slouken
New Revision: 4348

Modified:
trunk/SDL/src/video/x11/SDL_x11events.c
trunk/SDL/src/video/x11/SDL_x11mouse.c
Log:
The core pointer is comprised of merging the inputs of all mice.
If there are other mice, they should show up in the device list, and
we want to report events from those devices instead of the core events.
However, if XInput isn’t supported or we can’t find other mice in the
device list, we’ll add the core pointer and interpret normal mouse events.

I guess I feel rather foolish. The situation wasn’t complex at all…On Fri, Jan 2, 2009 at 3:43 PM, Donny Viszneki <@Donny_Viszneki> wrote:
On Sun, Jan 4, 2009 at 1:29 PM, wrote:

Date: 2009-01-04 10:29:20 -0800 (Sun, 04 Jan 2009)


http://codebad.com/