SyntaxBomb - Indie Coders

Languages & Coding => BlitzMax / BlitzMax NG => MaxGUI => Topic started by: Rooster on June 30, 2017, 08:19:47 AM

Title: "Import MaxGui.Drivers" messing up KeyHit/KeyDown ?
Post by: Rooster on June 30, 2017, 08:19:47 AM
I've been working on my entry for Qube's competition, and to get access to some MaxGUI commands I added "Import MaxGui.Drivers" to my program.
However, just adding that to my program has made KeyHit/KeyDown stop working, except for the few times it randomly does work.

The command I'm trying to use is ClientWidth(Desktop()), and ClientHeight(Desktop()).

Does anyone know how to fix this, or a alternative way to get the screen width and height?

Thanks!
Title: Re: "Import MaxGui.Drivers" messing up KeyHit/KeyDown ?
Post by: TomToad on June 30, 2017, 11:38:19 AM
non maxgui way to get desktop res
Code: [Select]
Print DesktopWidth() + " " + DesktopHeight()

Reason why MouseDown() n longer works in MaxGUI is because MaxGUI disables polling so you can handle these calls through events.  You can manually poll input by placing PollSystem() in your main loop, then KeyDown and MouseDown will work again.
Title: Re: "Import MaxGui.Drivers" messing up KeyHit/KeyDown ?
Post by: Rooster on June 30, 2017, 09:13:15 PM
Thank you TomToad. :)

For some reason I couldn't find those commands in the documentation.
SimplePortal 2.3.6 © 2008-2014, SimplePortal