Ooops
November 25, 2020, 08:56:40 AM

Author Topic: "Import MaxGui.Drivers" messing up KeyHit/KeyDown ?  (Read 1693 times)

Offline Rooster

  • Sr. Member
  • ****
  • Posts: 358
  • I don't know what this does...
"Import MaxGui.Drivers" messing up KeyHit/KeyDown ?
« 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!

Offline TomToad

  • Hero Member
  • *****
  • Posts: 517
Re: "Import MaxGui.Drivers" messing up KeyHit/KeyDown ?
« Reply #1 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.
------------------------------------------------
8 rabbits equals 1 rabbyte.

Offline Rooster

  • Sr. Member
  • ****
  • Posts: 358
  • I don't know what this does...
Re: "Import MaxGui.Drivers" messing up KeyHit/KeyDown ?
« Reply #2 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