public void mouseMoved(int x, int y, MouseEvent event) { if (myLastMotionReport != null && myLastMotionReport.equals(new Point(x, y))) { return; } if (shouldSendMouseData(MouseMode.MOUSE_REPORTING_ALL_MOTION)) { myTerminalOutput.sendBytes(mouseReport(MouseButtonCodes.RELEASE, x + 1, y + 1)); } myLastMotionReport = new Point(x, y); }
@Override public void mouseDragged(int x, int y, MouseEvent event) { if (myLastMotionReport != null && myLastMotionReport.equals(new Point(x, y))) { return; } if (shouldSendMouseData(MouseMode.MOUSE_REPORTING_BUTTON_MOTION)) { // when dragging, button is not in "button", but in "modifier" int cb = createButtonCode(event); if (cb != MouseButtonCodes.NONE) { cb |= MouseButtonModifierFlags.MOUSE_BUTTON_MOTION_FLAG; cb = applyModifierKeys(event, cb); myTerminalOutput.sendBytes(mouseReport(cb, x + 1, y + 1)); } } myLastMotionReport = new Point(x, y); }
public void setY(int y) { myCursorCoordinates.y = y; cursorChanged(); }
public void setX(int x) { myCursorCoordinates.x = x; cursorChanged(); }