I’m using SliderBar widget from Google Web Toolkit Incubator. By default, this widget listens to some keyboard events, e.g. left arrow. I’d like to know if there’s a way to avoid the widget listens to those events.
I’m using UiBinder and tried to use the function unsinkEvents but nothing happens. Here’s the snippet of code:
@UiField(provided = true)
SliderBar slbRotate;
public NewViewImpl() {
slbRotate = new SliderBar(-180,180);
slbRotate.setStepSize(10);
slbRotate.setCurrentValue(0);
slbRotate.setWidth("478px");
slbRotate.setHeight("22px");
slbRotate.unsinkEvents(Event.KEYEVENTS);
initWidget(binder.createAndBindUi(this));
}
I also used KeyCodes.KEY_LEFT in the argument of the unsinkEvents function, but doesn’t work either.
Thanks.
With the
function.
I created a short example to show the basics:
This example creates a TextBox and whenever you press a key two MessageBoxes (one for the keydown one for the keyup) pop up. If you call the unSinkKeyEvent function this behafios stops.
So if you don’t want to have speciffic behavior on SliderBar widget you just have too call the unsinkEvents function an specify the event you don’t want to have (just look at the help)
Regards,
Stefan