开发者

How to detect keydown up and down arrow in same time case Page Dance

开发者 https://www.devze.com 2023-04-11 19:10 出处:网络
helloI work at project to build dance game with AS 3.0 control by Page Dance. I got problem when player s开发者_StackOverflow中文版tomp two button in same time.

hello

I work at project to build dance game with AS 3.0 control by Page Dance.

I got problem when player s开发者_StackOverflow中文版tomp two button in same time.

How to detect it?

Thank you.


There is a lot of code in that pastebin, but the problem should not lie in your onKeys function.

What does this code do for you, when you press up and down at once?

function keyPressed(e:KeyboardEvent) {
    trace("Key event: " + e.keyCode);
}

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);

It returns two keycodes instantly for me. If it doesn't for you, your keyboard might not support for those two buttons to be pressed at once (most keyboards have a certain number of keys that are cross-wired to save cost, making it impossible to press them at once).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号