Page 1 of 1

InitMouse(#PB_Mouse_Locked)

Posted: Sat Oct 08, 2016 9:56 am
by MrTAToad
When passed as a parameter, #PB_Mouse_Locked doesn't actually seem to do anything - still get the system pointer displayed.

Re: InitMouse(#PB_Mouse_Locked)

Posted: Mon Oct 24, 2016 9:18 am
by Fred
Juts tried with Chrome and FireFox, and it seems to work as expected. Note: you need to click once on the screen to enable mouse locking.

Code: Select all

InitMouse(#PB_Mouse_Locked)

OpenScreen(800, 600, 32, "Test")

Procedure RenderFrame()
  Static x, y
  
  ClearScreen(RGB(0, 0, 0))
  
  If ExamineMouse()
    
    If MouseButton(#PB_MouseButton_Left)
      Debug "Left button"
    EndIf
    
    If MouseButton(#PB_MouseButton_Right)
      Debug "Right button"
    EndIf
    
    If MouseButton(#PB_MouseButton_Middle)
      Debug "Middle button"
    EndIf
    
    WheelDelta = MouseWheel()
    If WheelDelta
      Debug "Mouse wheel: " + WheelDelta
    EndIf
  EndIf
  
  FlipBuffers(); // continue the rendering
EndProcedure

BindEvent(#PB_Event_RenderFrame, @RenderFrame())
FlipBuffers(); 
ps: please always post a small full working snippet showing the bug so it's easier to test.

Re: InitMouse(#PB_Mouse_Locked)

Posted: Mon Oct 24, 2016 1:58 pm
by MrTAToad
Yes, I think the lack of initial clicking was the cause of the problem...