Skip to content

onKeyDown stop working for a key when another one is pressed #710

Open
@Tokyonono

Description

@Tokyonono

This problem can be easily reproduced on the Hello World sample.

Add "this.setKeyboardEnabled(true);" in the init method of a layer.
Add the following method to that layer:
onKeyDown:function(e){
console.log(e);
}

When a key is pressed, the console will show that key in the console at each update (it works for a combination of keys as well). If you keep pressing a key then press another one, only the last one will be shown in the console.

In most of platform games we need to be able to move and press a jump/shoot button at the same time. It can be easily by-passed (keep in memory that a button is pressed and release it on onKeyUp), but it is painful and doesn't seem to be a natural behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions