Created
April 28, 2016 16:37
-
-
Save ttencate/96e8896f944a097785caa0394f3e17dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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