Why wheel rolling doesn't trigger an event?

Hi, everybody.
I am now using SDL to implement a program that controls a robot.
I want to use mouse to control the robot, so I need every mouse event that
is available.

The SDL_mouse.h defined MOUSE_BUUTON_WHEELUP, as a value of
event.button.button. That is, when the wheel is rolled up, a
MOUSE_BUTTON_DOWN event
should be triggered, and event.button.button should be MOUSE_BUTOON_WHEELUP.

However, as I rolling the wheel, there was even not any event happens.
Needless to say to detect if
the wheel is rolled up and do the following works.

My system is linux, kernel 2.4.20, X-window 4.2.0, SDL version is 1.2.5.
What should I do?

p.s. The MOUSE_BUTTON_MIDDLE is available, i.e, when I PRESS the wheel, an
event of MOUSE_BUTTON_DOWN is triggerd and event.button.button is
MOUSE_BUTTON_MIDDLE.

Best Regard.

Hi,From: david_ho@eerise.com.tw (David Ho)
Subject: [SDL] Why wheel rolling doesn’t trigger an event?
Date: Mon, 17 Feb 2003 14:36:28 +0800

The SDL_mouse.h defined MOUSE_BUUTON_WHEELUP, as a value of
event.button.button. That is, when the wheel is rolled up, a
MOUSE_BUTTON_DOWN event
should be triggered, and event.button.button should be MOUSE_BUTOON_WHEELUP.

However, as I rolling the wheel, there was even not any event happens.
Needless to say to detect if
the wheel is rolled up and do the following works.

Does your X server recognize the mouse wheel? For example, could you scroll up/down
the document in Mozilla web browser by rolling the mouse wheel?

If not, you should add ‘Option “ZAxisMapping” “4 5”’ to “InputDevice” section in your
XF86Config-4. Maybe it will be like following. Another lines may differ from yours.

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option “Device” "/dev/psaux"
Option “Protocol” "PS/2"
Option “ZAxisMapping” “4 5” # ADD THIS LINE!!!
EndSection

Kentaro

I added these lines to my X86Config-4:

Option “Protocol” "IMPS/2"
Option “ZAxismapping” "4 5"
Option “Buttons” “5”

(remove the old PS/2 protocol line)

After that I was able to detect the (fake) button 3 and 4 events in SDL. I
haven’t tried to configure the mouse wheel as a separate axis yet, which is
what I really want.

Regards,

DanielOn Mon 17 Feb 03 07:36, David Ho wrote:

Hi, everybody.
I am now using SDL to implement a program that controls a robot.
I want to use mouse to control the robot, so I need every mouse event that
is available.

The SDL_mouse.h defined MOUSE_BUUTON_WHEELUP, as a value of
event.button.button. That is, when the wheel is rolled up, a
MOUSE_BUTTON_DOWN event
should be triggered, and event.button.button should be
MOUSE_BUTOON_WHEELUP.

However, as I rolling the wheel, there was even not any event happens.
Needless to say to detect if
the wheel is rolled up and do the following works.

My system is linux, kernel 2.4.20, X-window 4.2.0, SDL version is
1.2.5. What should I do?

Unfortunately SDL doesn’t support that yet. Wheel “button” events are all
you get right now.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Mon 17 Feb 03 07:36, David Ho wrote:

Hi, everybody.
I am now using SDL to implement a program that controls a robot.
I want to use mouse to control the robot, so I need every mouse event that
is available.

The SDL_mouse.h defined MOUSE_BUUTON_WHEELUP, as a value of
event.button.button. That is, when the wheel is rolled up, a
MOUSE_BUTTON_DOWN event
should be triggered, and event.button.button should be
MOUSE_BUTOON_WHEELUP.

However, as I rolling the wheel, there was even not any event happens.
Needless to say to detect if
the wheel is rolled up and do the following works.

My system is linux, kernel 2.4.20, X-window 4.2.0, SDL version is
1.2.5. What should I do?

I added these lines to my X86Config-4:

Option “Protocol” "IMPS/2"
Option “ZAxismapping” "4 5"
Option “Buttons” “5”

(remove the old PS/2 protocol line)

After that I was able to detect the (fake) button 3 and 4 events in SDL. I
haven’t tried to configure the mouse wheel as a separate axis yet, which is
what I really want.

And same goes to almost all X apps as well. They only support the mapped
buttons. Which is quite sad for those lucky ones who have mouse with
analog wheel.On Monday 17 February 2003 23:50, Sam Lantinga wrote:

On Mon 17 Feb 03 07:36, David Ho wrote:

Hi, everybody.
I am now using SDL to implement a program that controls a robot.
I want to use mouse to control the robot, so I need every mouse
event that is available.

The SDL_mouse.h defined MOUSE_BUUTON_WHEELUP, as a value of
event.button.button. That is, when the wheel is rolled up, a
MOUSE_BUTTON_DOWN event
should be triggered, and event.button.button should be
MOUSE_BUTOON_WHEELUP.

However, as I rolling the wheel, there was even not any event
happens. Needless to say to detect if
the wheel is rolled up and do the following works.

My system is linux, kernel 2.4.20, X-window 4.2.0, SDL
version is 1.2.5. What should I do?

I added these lines to my X86Config-4:

Option “Protocol” "IMPS/2"
Option “ZAxismapping” "4 5"
Option “Buttons” “5”

(remove the old PS/2 protocol line)

After that I was able to detect the (fake) button 3 and 4 events in
SDL. I haven’t tried to configure the mouse wheel as a separate
axis yet, which is what I really want.

Unfortunately SDL doesn’t support that yet. Wheel “button” events
are all you get right now.