Page 1 of 1
Reading mouse not working?
Posted: Wed Mar 30, 2011 5:08 pm
by Brujah
We found out that we have to read the mouse before the keyboard, otherwise mouse cannot be read at all.
Annoying but okay, at least we found it.
Now we found out that its only working in windowed mode. When we start the game in fullscreen mode mouse can still not be read.
We do nothing else than examinekeyboard and examinemouse.
So whats wrong with purebasic under linux that we cannot access the mouse?
Re: Reading mouse not working?
Posted: Wed Mar 30, 2011 9:17 pm
by idle
You need to get the order right
ExamineMouse()
ExamineKeyboard()
otherwise it ends up eating the mouse events
Re: Reading mouse not working?
Posted: Wed Mar 30, 2011 10:20 pm
by Brujah
Thats what we did. But its still working only in Windowed mode.
When I start in Fullscreen Mode Mouse cannot be accessed still.
Re: Reading mouse not working?
Posted: Wed Mar 30, 2011 10:32 pm
by idle
maybe you'll have to do a windowed screen without a boarder and set the stretch mode
Re: Reading mouse not working?
Posted: Wed Mar 30, 2011 11:44 pm
by Zefz
Thanks, that did the trick
Here is the code for anyone who is interested:
Code: Select all
;Open video Screen
If win_mode
screenID = OpenWindow(0, 0, 0, 640, 480, "Lost Labyrinth", #PB_Window_Maximize|#PB_Window_ScreenCentered|#PB_Screen_SmartSynchronization|#PB_Window_BorderLess)
screenopen = 1
Else
;Windowed mode
screenID = OpenWindow(0, 0, 0, 640, 480, "Lost Labyrinth",#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Screen_SmartSynchronization)
screenopen = 2
windowsfenster = #True
EndIf
If Not screenID Or Not OpenWindowedScreen(screenID, 0, 0, 640, 480, #True, 0, 0)
PrintN("Screen could bot be opened!")
End
EndIf
[EDIT]: just fixed the above with simpler code
Re: Reading mouse not working?
Posted: Thu Mar 31, 2011 12:26 am
by Brujah
How would I do that?
I tried around a lot but its still not working.
Re: Reading mouse not working?
Posted: Thu Mar 31, 2011 1:24 am
by Zefz
Ah yes true... the code above seems to work perfectly on Windows, but on Linux the window does not properly stretch to fullscreen (it stays 640x480 pixels in the middle of the screen while the rest around is simply white).
Autostretch problem on Linux?