if(event.getNativeEvent().getButton() == NativeEvent.BUTTON_RIGHT)
{
GWT.log("Right Click", null);
}
else
{
GWT.log("Left Click", null);
}
This notebook is a collection of code snippets and technical "how to" instructions.
Search This Blog
Mouse Button Click
by: Jordan Beck
If you need to determine which button is clicked on a mouse with a ClickHandler, you can use the NativeEvent class. Here is code that determines whether or not the ClickHandler was trigger by a right click or not (event is ClickEvent):
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment