use of org.rstudio.core.client.events.MouseDragHandler.MouseCoordinates in project rstudio by rstudio.
the class SignatureToolTipManager method attachPreviewHandler.
private void attachPreviewHandler() {
detachPreviewHandler();
preview_ = Event.addNativePreviewHandler(new NativePreviewHandler() {
@Override
public void onPreviewNativeEvent(NativePreviewEvent preview) {
if (preview.getTypeInt() == Event.ONMOUSEMOVE) {
NativeEvent event = preview.getNativeEvent();
coordinates_ = new MouseCoordinates(event.getClientX(), event.getClientY());
ready_ = true;
} else if (preview.getTypeInt() == Event.ONKEYDOWN) {
coordinates_ = null;
ready_ = true;
if (preview.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE)
suppressed_ = true;
}
}
});
}
Aggregations