How can I get MouseWheel status? (api)
Posted: Wed Feb 08, 2006 10:25 pm
How can I get MouseWheel status without using ExamineMouse()?
Think I need some windows-api code!
Thanks!

Think I need some windows-api code!
Thanks!
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Procedure.l WinCallback(hwnd, msg, wparam, lparam)
result = #PB_ProcessPureBasicEvents
Select msg
Case #WM_MOUSEWHEEL
If wparam < 0
direction$ = "Scrolling towards user"
Else
direction$ = "Scrolling away from user"
EndIf
SetGadgetText(0, direction$)
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 0, 0, 300, 200, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "Detect Mousewheel") And CreateGadgetList(WindowID(0))
SetWindowCallback(@WinCallback())
TextGadget(0, 10, 50, 280, 25, "", #PB_Text_Center)
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
EndIf
End
That didn't work :roll:blueznl wrote:check on events, they're 511 and 512 iirc, one for up, one for down
Code: Select all
If OpenWindow(0,300,300,400,200,#PB_Window_SystemMenu,"test")
CreateGadgetList(WindowID(0))
TextGadget(0,20,20,200,20,"Scroll the mouse wheel...")
Repeat
ev=WaitWindowEvent()
If ev=#WM_MOUSEWHEEL
If EventwParam()>0
SetGadgetText(0,"UP")
ElseIf EventwParam()<0
SetGadgetText(0,"DOWN")
EndIf
EndIf
Until ev=#PB_Event_CloseWindow
EndIf