[SDL 1.3] Mouse Button Index

Hello,

I’m using SDL 1.3 on Windows XP and Linux Ubuntu (emulated in
VirtualBox) and it seems that the button’s index for right and middle
button of the mouse are swapped (in the SDL_MouseButtonEvent structure).

On Windows, the left button is index 1, the right is 2 and the middle is 3.

On Linux, the left is 1, the middle is 2 and the right is 3.

Is it a bug in SDL ?

Did the index depends on the system and/or the mouse ?

Thank you very much for your replies.

Yannick Bersier

Hello,

I’m using SDL 1.3 on Windows XP and Linux Ubuntu (emulated in
VirtualBox) and it seems that the button’s index for right and middle
button of the mouse are swapped (in the SDL_MouseButtonEvent structure).

On Windows, the left button is index 1, the right is 2 and the middle is 3.

On Linux, the left is 1, the middle is 2 and the right is 3.

Is it a bug in SDL ?

Yes, it sounds like it.

From the header:
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3

I’ll take a look.

Thanks!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

I’m using SDL 1.3 on Windows XP and Linux Ubuntu (emulated in
VirtualBox) and it seems that the button’s index for right and middle
button of the mouse are swapped (in the SDL_MouseButtonEvent structure).

This is fixed in subversion.

Thanks! :slight_smile:

-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

The 3 buttons work fine on both Windows and Linux now.

Thank you :smiley:

Yannick Bersier

Sam Lantinga a ?crit :>>Hello,

I’m using SDL 1.3 on Windows XP and Linux Ubuntu (emulated in
VirtualBox) and it seems that the button’s index for right and middle
button of the mouse are swapped (in the SDL_MouseButtonEvent structure).

On Windows, the left button is index 1, the right is 2 and the middle is 3.

On Linux, the left is 1, the middle is 2 and the right is 3.

Is it a bug in SDL ?

Yes, it sounds like it.

From the header:
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3

I’ll take a look.

Thanks!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

The 3 buttons work fine on both Windows and Linux now.

Thank you :smiley:

You’re welcome! Thanks for the report! :slight_smile:

See ya,
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment