The Nice Bug!

Report any Hollywood bugs here
Post Reply
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

The Nice Bug!

Post 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
jalih
Posts: 276
Joined: Fri Jun 18, 2010 8:08 pm
Location: Finland

Re: The Nice Bug!

Post by jalih »

Hi,

I noticed similar bug with string requester while I did the Asteroids game.
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: The Nice Bug!

Post by Allanon »

Well, so it seems related with requesters in general...
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: The Nice Bug!

Post 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?
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: The Nice Bug!

Post by Allanon »

I can't say, I've encountered the problem on Windows, anyway, thank you :)
User avatar
lazi
Posts: 625
Joined: Thu Feb 24, 2011 11:08 pm

Re: The Nice Bug!

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