mouse wheel

Linux specific forum
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

mouse wheel

Post by idle »

I'm trying to figure out how to get the mouse wheel direction in a windowed screen with opengl subsytem

The SetWindowCallback tip I posted doesn't work once the screen is opened and I don't know if gdk_add_client_message_filter ()
would work either.

window callback

Any ideas?
Windows 11, Manjaro, Raspberry Pi OS
Image
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: mouse wheel

Post by IdeasVacuum »

Hello Idle

PB's own ExamineMouse() + MouseWheel() does not work? I have used it with a windowed screen, but not with openGL.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: mouse wheel

Post by idle »

No the PB mousewheel doesn't work
Windows 11, Manjaro, Raspberry Pi OS
Image
GBeebe
Enthusiast
Enthusiast
Posts: 263
Joined: Sat Oct 09, 2004 6:52 pm
Location: Franklin, PA - USA
Contact:

Re: mouse wheel

Post by GBeebe »

When using OpenGL, I start with SDL to create the window for me:

Code: Select all

Screen = SDL_SetVideoMode_(width, height, depth, #SDL_OPENGL | #SDL_FULLSCREEN)
Then, to get your wheel events:

Code: Select all

While SDL_PollEvent_(@Event.SDL_Event)

    Select Event\Type
       Case #SDL_MOUSEBUTTONDOWN
                If Event\button\button = 4
                    MouseWheels + 1 ;will add to the scrolling
                ElseIf event\button\button = 5
                    MouseWheels - 1 ;will subtract from the scrolling
                EndIf
    EndSelect

Wend
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: mouse wheel

Post by idle »

Thanks for that, I will give it a go.
Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply