Author Topic: Keypress on Minimize fix!  (Read 1437 times)

Offline TechSY730

  • Core Member Mark V
  • *****
  • Posts: 4,570
Keypress on Minimize fix!
« on: May 02, 2012, 08:03:54 pm »
Link
Quote from: AVWW 1.008 release notes
    After yet more wrestling with the underlying Unity 3D engine, we've finally managed to work around yet another of the engine bugs that really annoy people a lot. This one was related to keys not properly getting cleared when (for instance) you alt-tab out of the game. The alt key would usually remain stuck on until you tapped it again.
        Previously we were unable to solve this at all because we could not detect loss of focus, but we discovered a hack to get around that shortly before 1.0 (to everyone's joy, ours most of all).
        The next problem was that, even knowing when we had lost focus, the problem was that the Unity 3D engine's Input.GetKey and Input.anyKeyDown and so forth were the things returning the wrong results. Not being able to fix their code directly, we were fortunate to find a Input.ResetInputAxes method that lets us just clear all the input state in their engine when we detect the resumption of game focus using our aforementioned hack.
        And there was much rejoicing! This will be coming to AI War as well, before anyone asks.
(emphasis added)

YESSSSSS!!!

I would post a silly gif, probably of silly "happy dancing" and turn this into a "gif spam" thread, but I don't have any funny gifs on me at the moment.

So instead, I must settle with M. Bison's opinion on the matter

Offline omegajasam

  • Jr. Member
  • **
  • Posts: 56
Re: Keypress on Minimize fix!
« Reply #1 on: May 03, 2012, 08:37:55 am »
...Does this mean we can get modifyer keys as an option for the controls without unity bug now?

Offline tigersfan

  • Arcen Games Contractor
  • Arcen Staff
  • Master Member Mark II
  • *****
  • Posts: 1,599
Re: Keypress on Minimize fix!
« Reply #2 on: May 03, 2012, 09:31:42 am »
See, I was more excited that the game can now be paused when I accidently click on my second monitor. :-D

Also, I'll say that Chris was pretty excited when he discovered this.

Offline mrhanman

  • Hero Member Mark II
  • *****
  • Posts: 764
Re: Keypress on Minimize fix!
« Reply #3 on: May 03, 2012, 09:36:23 am »
Woohoo!  I'm really glad this one was put to bed.  It's great that it applies to AI War, too.

Offline tigersfan

  • Arcen Games Contractor
  • Arcen Staff
  • Master Member Mark II
  • *****
  • Posts: 1,599
Re: Keypress on Minimize fix!
« Reply #4 on: May 03, 2012, 10:18:44 am »
Woohoo!  I'm really glad this one was put to bed.  It's great that it applies to AI War, too.

Well, it's not IN AI: War yet, but, since the underlying cause is the same for both games, we can use the same fix there too. :)

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Keypress on Minimize fix!
« Reply #5 on: May 03, 2012, 10:57:00 am »
...Does this mean we can get modifyer keys as an option for the controls without unity bug now?

Yep!  Now we just have to deal with logic issues with what happens with binding clashes, but I believe that was solved pretty well for AI War so it may not be as bad as I'd been thinking it could be.  That's one that should go in mantis because there's not time for it this week, but this certainly opens the door for that feature!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!