sender, e.time & 0xffffffff, MOUSE_ID, buttonStatus,
getStateMask(e),
getControlPosition(e), getScreenPosition(e),
- MouseWheelMovedEvent.WHEEL_UNIT_SCROLL,
- 0,
+ MouseWheelMovedEvent.WHEEL_UNIT_SCROLL,
+ MouseWheelMovedEvent.SCROLL_AMOUNT_ZERO,
e.count
));
}
return EventTypes.AnyMask;
}
- /**
- *
- */
- private MouseWheelMovedEvent lastMouseWheelMovedEvent;
-
private static final String DISABLE_DUPLICATE_REMOVAL = "org.simantics.scenegraph.g2d.events.disableDuplicateMouseWheelEvent";
private static final boolean IGNORE_DUPLICATE = !Boolean.parseBoolean(System.getProperty(DISABLE_DUPLICATE_REMOVAL));
private boolean ignoreDuplicateMouseWheelMovedEvent(Event e) {
if (IGNORE_DUPLICATE && e instanceof MouseWheelMovedEvent) {
- if (e.time > 0 && (lastMouseWheelMovedEvent != null && lastMouseWheelMovedEvent.time < 0)) {
+ MouseWheelMovedEvent event = (MouseWheelMovedEvent) e;
+ // if (e.time > 0 && (lastMouseWheelMovedEvent != null && lastMouseWheelMovedEvent.time < 0)) {
+ // apparently this is a better way to distinguish between SWT & AWT events
+ // SWT based event constructs the scrollAmount to = 0
+ // See org.simantics.g2d.event.adapter.SWTMouseEventAdapter.mouseScrolled(MouseEvent) L171
+ if (event.scrollAmount != MouseWheelMovedEvent.SCROLL_AMOUNT_ZERO) {
return true;
}
- lastMouseWheelMovedEvent = (MouseWheelMovedEvent) e;
}
return false;
}