Page 1 of 1

The Nice Bug!

Posted: Tue Apr 21, 2015 7:01 pm
by Allanon
Hello Andreas,
I've isolated a new bug and here is a sample code to reproduce it.
This bug prevent the detection of LShift and RShift with the command IsKeyDown() after a FileRequester() has been called.
This bug is so nasty that I've called it "The Nice Bug" :mrgreen:

here is the code:

Code: Select all

DebugPrint("== THE NICE BUG ==")
DebugPrint("Hit some keys with or without shift to view")
DebugPrint("the shift key state.")
DebugPrint("Hit 'l' to pop up a useless file requester")
DebugPrint("that will let the bug activate.")
DebugPrint("Close the requester selecting a file and try")
DebugPrint("again to hit some keys with and without shift.")
DebugPrint("Now l-shift and r-shift are no more detected!")
DebugPrint("-------------------------------")
DebugPrint("Activate the program window and start type something...")

Function checkKeys(msg)
  DebugPrint("KEYBOARD HANDLER MESSAGE:")
  ForEach(msg, DebugPrint)
  DebugPrint("LEFT SHIFT STATE : ", IsKeyDown("LSHIFT"))
  DebugPrint("RIGHT SHIFT STATE: ", IsKeyDown("RSHIFT"))
  DebugPrint("-------------------------")
  If msg.key = "l"
    Local f = FileRequest("Select a file to read...", "*.*", #REQ_NORMAL)
  EndIf
EndFunction

InstallEventHandler( { OnKeyUp = checkKeys })

Repeat
  WaitEvent()
Forever

Re: The Nice Bug!

Posted: Tue Apr 21, 2015 7:09 pm
by jalih
Hi,

I noticed similar bug with string requester while I did the Asteroids game.

Re: The Nice Bug!

Posted: Wed Apr 22, 2015 12:08 am
by Allanon
Well, so it seems related with requesters in general...

Re: The Nice Bug!

Posted: Wed Apr 22, 2015 9:23 pm
by airsoftsoftwair
Right, this is fixed now but I only managed to reproduce it on Windows. It doesn't seem to occur on any other platform, right?

Re: The Nice Bug!

Posted: Wed Apr 22, 2015 11:44 pm
by Allanon
I can't say, I've encountered the problem on Windows, anyway, thank you :)

Re: The Nice Bug!

Posted: Sun Oct 25, 2015 8:33 pm
by lazi
airsoftsoftwair wrote:Right, this is fixed now but I only managed to reproduce it on Windows. It doesn't seem to occur on any other platform, right?
I can confirm that it seems to be only happen in windows.