For instance, I run the included Gadget.pb example (Window based gadgets) and clicks work fine, but when I run Mouse.pb (Screen based), the logo graphic moves with the mouse as expected, but it is impossible to exit the running program, as left-clicks are ignored. I had to add "KeyboardPushed(#PB_Key_Escape)" as the Until condition to get the example not be be stuck in its Repeat loop.
I'm on a MacBookPro, OS X 10.7.5, using v5.10 Revision: 1472 64-bit version (the demo). I tried with both trackpad and a usb Logitech mouse - same results. With a Screen, mouse movement registers, clicks do not.
I altered the Mouse.pb to be a bit shorter to demonstrate this. Position of logo should change when left-click, but does not. Can others take a look at this and the original Mouse.pb to confirm? Thanks!
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Mouse example file
;
; (c) 2001 - Fantaisie Software
;
; ------------------------------------------------------------
;
If InitMouse() = 0 Or InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester("Error", "Can't initialize", 0)
End
EndIf
;
;-------- MessageReq and OpenScreen --------
;
MessageRequester("Information", "This will test the fast mouse access..."+Chr(10)+"Press esc to quit!", 0)
If OpenScreen(1024, 768, 32, "Mouse") = 0
MessageRequester("Error", "Impossible to open screen",0)
End
EndIf
;
;-------- Init and Load Stuff --------
;
x = 100
y = 100
LoadSprite(0, "Data/PureBasic.bmp", 0) ; Load nice small Logo
;
;-------- MainLoop --------
;
Repeat
FlipBuffers() ; Flip for DoubleBuffering
ClearScreen(RGB(0,0,0)) ; CleanScreen, black
ExamineKeyboard()
ExamineMouse()
x = MouseX() ; Returns actual x pos of our mouse
y = MouseY() ; Returns actual y pos of our mouse
If MouseButton(#PB_MouseButton_Left)
MouseLocate(400, 300)
EndIf
DisplaySprite(0, x-SpriteWidth(0)/2, y-SpriteHeight(0)/2)
Until KeyboardPushed(#PB_Key_Escape)
End 

