Reading mouse not working?

Linux specific forum
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Reading mouse not working?

Post 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?
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Reading mouse not working?

Post by idle »

You need to get the order right

ExamineMouse()
ExamineKeyboard()

otherwise it ends up eating the mouse events
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Re: Reading mouse not working?

Post 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.
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Reading mouse not working?

Post by idle »

maybe you'll have to do a windowed screen without a boarder and set the stretch mode
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Zefz
New User
New User
Posts: 8
Joined: Wed Mar 30, 2011 11:41 pm
Location: Norway

Re: Reading mouse not working?

Post 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
User avatar
Brujah
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Nov 03, 2003 7:45 pm
Location: Germany
Contact:

Re: Reading mouse not working?

Post by Brujah »

How would I do that?
I tried around a lot but its still not working.
User avatar
Zefz
New User
New User
Posts: 8
Joined: Wed Mar 30, 2011 11:41 pm
Location: Norway

Re: Reading mouse not working?

Post 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?
Post Reply