Shift key in GWT?

Is there a way in GWT to determine if the Shift key is inside the onClick() handler?

For example:

 import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; public class PanelTileBase implements ClickHandler { PanelTileBase() { addClickHandler(this); } public void onClick(ClickEvent event) { // is the shift key down? } } 

Thanks!

+6
gwt
source share
3 answers

How about this (untested)

 void onClick(ClickEvent ev) { NativeEvent nEv = ev.getNativeEvent(); if ( nEv.getShiftKey() ) { // event is true. } } 
+7
source share

And for the keyboard API changed, but the idea is the same:

 if (event.isShiftKeyDown()) { // your code } 
+1
source share

The GWT KeyEvent API has {Alt, AnyModifier, Control, Meta, Shift} KeyDown () functions.

0
source share