Flash build thinks keys are down when they aren't

Hello.

Unity Flash keyboard handling seems to break if I do this:

  1. Press down a key.

  2. Click outside the Flash frame.

  3. Release the key. The game still behaves as if the key was down.

  4. Click inside the Flash frame. The game still behaves as if the key was down.

I can only correct this by pressing and releasing the same key again. So looks like Unity never receives the key release event. Unity webplayer seems to handle this way better by assuming all keys released if you click outside the webplayer frame.

Any ideas how to get around this? Our app has stuff in the surrounding website so it would be nice to avoid weird behavior is the user clicks on them.

How do you detect your key presses? GetKeyDown? GetKeyUp? Another way?

Seems to me if you were using GetKey or GetButton this problem could easily occur. If you used GetKeyDown or GetKeyUp or GetButtonDown or GetButtonUp, it would only look for a rising or falling edge of the input and eliminate the chance of it getting stuck in 1 position.