public void testKeyEvents() {
final Flag flag = new Flag();
manager = new HandlerManager(flag);
HandlerRegistration downRegistration = manager.addHandler(
KeyDownEvent.TYPE, new KeyDownHandler() {
public void onKeyDown(KeyDownEvent event) {
flag.flag = true;
}
});
HandlerRegistration upRegistration = manager.addHandler(KeyUpEvent.TYPE,
new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
flag.flag = true;
}
});
HandlerRegistration pressRegistration = manager.addHandler(
KeyPressEvent.TYPE, new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
flag.flag = true;
}
});