> - The SCROLL_MASK_PHASE_CANCELLED and SCROLL_MASK_PHASE_ENDED scroll masks > are added.
Now we use the scrollMask value and the following constants: static final int SCROLL_MASK_WHEEL = 1; static final int SCROLL_MASK_TRACKPAD = 1 << 1; static final int SCROLL_MASK_PHASE_BEGAN = 1 << 2; static final int SCROLL_MASK_PHASE_CANCELLED = 1 << 3; static final int SCROLL_MASK_PHASE_ENDED = 1 << 4; All these masks cannot be used together. So I suggest to replace it with the scrollPhase value: static final int SCROLL_PHASE_UNSUPPORTED = 0; // for mouse events static final int SCROLL_PHASE_BEGAN = 1; static final int SCROLL_PHASE_CONTINUED = 2; static final int SCROLL_PHASE_CANCELLED = 3; static final int SCROLL_PHASE_ENDED = 4; It simplifies if-statements: - if ((scrollMask & NSEvent.SCROLL_MASK_PHASE_BEGAN) != 0) { + if (scrollPhase == NSEvent.SCROLL_PHASE_BEGAN) { and the following method: + (jint) scrollTypeToMask: (NSEventPhase) phase { if (phase) return SCROLL_PHASE_UNSUPPORTED; switch (phase) { case NSEventPhaseBegan: return SCROLL_MASK_PHASE_BEGAN; case NSEventPhaseCancelled: return SCROLL_MASK_PHASE_CANCELLED; case NSEventPhaseEnded: return SCROLL_MASK_PHASE_ENDED; } return SCROLL_PHASE_CONTINUED; } What do you think? -- Best regards, Sergey A. Malenkov