Created
July 20, 2016 08:27
-
-
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
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
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