Skip to content

Instantly share code, notes, and snippets.

@3ffusi0on
Created July 20, 2016 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3ffusi0on/f9c9ea4668ca016949124b49447cde54 to your computer and use it in GitHub Desktop.
Save 3ffusi0on/f9c9ea4668ca016949124b49447cde54 to your computer and use it in GitHub Desktop.
Catch Tab key, don't print it and change it's action with SWT
new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
e.doit = false;
// Action
}
}
};
new VerifyKeyListener() {
@Override
public void verifyKey(VerifyEvent event) {
if ((event.character == SWT.TAB)) {
event.doit = false;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment