Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
addListener(new InputListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
if (event.getTarget() == DefaultDialog.this && x < 0 || y < 0 || x > getWidth() || y > getHeight()) {
hide();
return true;
}
return false;
}
@Override
public boolean keyDown(InputEvent event, int keycode) {
switch (keycode) {
case Keys.BACK:
case Keys.ESCAPE:
hide();
}
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment