PB x.xx WindowedScreen Mouse library

Post bugreports for the Linux version here
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

PB x.xx WindowedScreen Mouse library

Post by mk-soft »

At first I thought that it is because of my virtualization (Parallels) that the mouse positions (MouseXY, MouseDeltaXY) do not work under Linux.
But on my Raspberry PI 4 (Bullseye) they don't work either.

Code: Select all

InitKeyboard()
InitMouse()
InitSprite()

If OpenWindow(0,50,50,640,480,"Windowed Screen", #PB_Window_WindowCentered | #PB_Window_SystemMenu)
  SetWindowColor(0, #Blue)
  OpenWindowedScreen(WindowID(0),10,10,620,460,0,0,0,#PB_Screen_WaitSynchronization)
  
  CreateSprite(1,16,16)
  StartDrawing(SpriteOutput(1))
  Box(1, 1, 14, 14, #Red)
  StopDrawing()
  
  Repeat
    
    Repeat
      Select WindowEvent()
        Case 0
          Break
        Case #PB_Event_CloseWindow
          Break 2
      EndSelect
    ForEver
    
    ExamineMouse()
    ExamineKeyboard()
    
    ClearScreen(RGB(255,255,255))
    
    DisplaySprite(1,MouseX() - 8,MouseY() - 8)
    
    If MouseButton(#PB_MouseButton_Left)
      If Not fm_left
        fm_left = 1
        Debug "Mouse left"
      EndIf
    ElseIf fm_left
      fm_left = 0
    EndIf
    
    If MouseButton(#PB_MouseButton_Middle)
      If Not fm_middle
        fm_middle = 1
        Debug "Mouse middle"
      EndIf
    ElseIf fm_middle
      fm_middle = 0
    EndIf
    
    If MouseButton(#PB_MouseButton_Right)
      If Not fm_right
        fm_right = 1
        Debug "Mouse right"
      EndIf
    ElseIf fm_right
      fm_right = 0
    EndIf
    
    FlipBuffers()
    
    If KeyboardReleased(#PB_Key_F10)
      If Not rm
        rm = 1
        ReleaseMouse(#True)
      Else
        rm = 0
        ReleaseMouse(#False)
      EndIf
    EndIf
    
  Until KeyboardPushed(#PB_Key_Escape)
EndIf

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
thyphoon
Enthusiast
Enthusiast
Posts: 327
Joined: Sat Dec 25, 2004 2:37 pm

Re: PB x.xx WindowedScreen Mouse library

Post by thyphoon »

i have the same problem ! have you find a solution ? 😅
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB x.xx WindowedScreen Mouse library

Post by mk-soft »

Yes, I have a solution :wink:

Link: Linux Screen3DMousePatch
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