Is there a way in GWT to tell if the Shift key is down inside of an 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!
How about this (untested)
void onClick(ClickEvent ev) {
NativeEvent nEv = ev.getNativeEvent();
if ( nEv.getShiftKey() ) {
// event is true.
}
}
And for the keyboard API changed, but the idea is the same:
if (event.isShiftKeyDown()) {
// your code
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With