keyUp called when key is still pressed
See original GitHub issuepublic class DesktopLauncher {
public static void main(String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = 480;
config.height = 320;
new LwjglApplication(new ApplicationListener() {
public void resume() {
}
@Override
public void resize(int width, int height) {
}
@Override
public void render() {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
}
@Override
public void pause() {
}
@Override
public void dispose() {
}
@Override
public void create() {
Gdx.input.setInputProcessor(new InputProcessor() {
@Override
public boolean touchUp(int screenX, int screenY,
int pointer, int button) {
return false;
}
@Override
public boolean touchDragged(int screenX, int screenY,
int pointer) {
return false;
}
@Override
public boolean touchDown(int screenX, int screenY,
int pointer, int button) {
return false;
}
@Override
public boolean scrolled(int amount) {
return false;
}
@Override
public boolean mouseMoved(int screenX, int screenY) {
return false;
}
@Override
public boolean keyUp(int keycode) {
System.out.println("keyup");
return false;
}
@Override
public boolean keyTyped(char character) {
System.out.println("keytyped");
return false;
}
@Override
public boolean keyDown(int keycode) {
System.out.println("keydown");
return false;
}
});
}
}, config);
}
}
When a key is pressed (not release yet):
keydown
keytyped
keyup
keydown
keytyped
keyup
keydown
keytyped
keyup
keydown
keytyped
keyup
keydown
keytyped
keyup
....
Tested on iMac 2012, libgdx version 1.6.3
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
When CMD key is kept pressed, keyup is not triggered for any ...
The problem is keyup is not being triggered for the LEFT key (or any key for that matter) as long as the CMD...
Read more >Element: keyup event - Web APIs | MDN
The keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered.
Read more >Keyboard: keydown and keyup - The Modern JavaScript Tutorial
The keydown events happens when a key is pressed down, and then keyup – when it's released. event.code and event.key. The key property...
Read more >.keyup() | jQuery API Documentation
The keyup event is sent to an element when the user releases a key on the keyboard. It can be attached to any...
Read more >Keydown is the only keyboard event we need - Mutually Human
If you cancel a keydown event it will prevent the browser from performing that action. But, it will not prevent keyup from firing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Since it’s been so long I doubt anyone will see this however, it’s happening to me on windows. I have key filtering turned off.
Can’t reproduce on any of the “big-3” operating systems, so it must be something on your end.
I’m going to close this one out.