MouseWheel not working

Just starting out? Need help? Post your questions and find answers here.
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 184
Joined: Thu Dec 28, 2023 9:04 pm

MouseWheel not working

Post by rndrei »

Why doesn't the mouse wheel work?

Code: Select all

Procedure EventHandler()
    Select Event()
      Case #PB_Event_CloseWindow
        End 
      Case #PB_Event_Gadget
        Debug "Gadget #" + EventGadget() + " pushed"
    EndSelect        
    Select EventType()
      Case #PB_EventType_MouseWheel
        MessageRequester("", "MouseWheel")
    EndSelect 
  EndProcedure 
  
  OpenWindow(0, 100, 100, 300, 100, "", #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_MaximizeGadget)
  ButtonGadget(0, 10, 10, 100, 30, "Push me") 
  BindGadgetEvent(0, @EventHandler())
  BindEvent(#PB_Event_CloseWindow, @EventHandler()) 
  Repeat
    WaitWindowEvent()
  ForEver
User avatar
mk-soft
Always Here
Always Here
Posts: 6320
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: MouseWheel not working

Post by mk-soft »

A button have not a event type mouse wheel
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 184
Joined: Thu Dec 28, 2023 9:04 pm

Re: MouseWheel not working

Post by rndrei »

I figured it out, beta doesn’t work in version 6.12.

Code: Select all

If OpenWindow(0, 0, 0, 220, 220, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CanvasGadget(0, 10, 10, 200, 200)   
    Repeat
      Event = WaitWindowEvent()         
      If Event = #PB_Event_Gadget And EventGadget() = 0 
          If EventType() = #PB_EventType_MouseWheel 
           If StartDrawing(CanvasOutput(0))
            x = GetGadgetAttribute(0, #PB_Canvas_MouseX)
            y = GetGadgetAttribute(0, #PB_Canvas_MouseY)
            Circle(x, y, 10, RGB(Random(255), Random(255), Random(255)))
            StopDrawing()
          EndIf
          EndIf
      EndIf        
    Until Event = #PB_Event_CloseWindow
  EndIf
User avatar
mk-soft
Always Here
Always Here
Posts: 6320
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: MouseWheel not working

Post by mk-soft »

As already reported a bug in the Linux version 6.12 beta x.
It works under windows and macOS.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply