void (KeyEvent event) { super.keyPressed(event); int diff = BitUtil.isSet(event.getModifiers(), Event.SHIFT_MASK) ? 10 : 1; Point location = updateLocation(); if (myRobot != null && location != null) { switch (event.getKeyCode()) { case KeyEvent.VK_DOWN -> myRobot.mouseMove(location.x, location.y + diff); case KeyEvent.VK_UP -> myRobot.mouseMove(location.x, location.y - diff); case KeyEvent.VK_LEFT -> myRobot.mouseMove(location.x - diff, location.y); case KeyEvent.VK_RIGHT -> myRobot.mouseMove(location.x + diff, location.y); } updateLocation(); } }