-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HTML5] KEY_UP event fails to fire when Command is held #1705
Comments
Since Cmd+C is the keyboard shortcut for copy, I wonder if the browser simply isn't dispatching an event to JS when that command is triggered by the user. Does it make a difference if you call |
the up event is still not* firing after trying: stage.addEventListener(KeyboardEvent.KEY_DOWN,
function (e)
{
if (e.keyCode == C)
{
if (e.ctrlKey)
{
field.text = "Cmd + C pressed";
e.preventDefault();
}
else
{
field.text = "C pressed";
}
}
}
); |
Does this happen with keys other than C (or V)? |
this seems to happen with all keys, but i can now confirm that that e.preventDefault does prevent the normal action of the key combo, except cmd + w and cmd + q (close the window). notably, cmd + h normally hides the active window, and that is prevented. I assume hide, just like W or Q are system commands and not browser commands |
example:
when I press Cmd+C the test says "Cmd + C pressed", but on release the text does not change until I press and release C again. If I press Cmd+C and release Cmd before C it shows "C released", as expected
Note: Even though I'm using
FlxKey.C
, I haven't instantiated aFlxGame
, or called any flixel utilities that would eat up events withpreventDefault
or somethingThe text was updated successfully, but these errors were encountered: