protected boolean inRange ( NativeMouseEvent e ) { Rectangle r = screenRegion . getBounds ( ) ; r . x += screenOffsetX ; r . y += screenOffsetY ; int x = e . getX ( ) ; int y = e . getY ( ) ; return r . contains ( x , y ) ; }
Check the mouse action is within the screen region range .