public class MouseSim extends Service
authProvider, defaultLocalization, dnaPool, fs, id, inbox, interfaceSet, isVirtual, lastError, lastErrorTs, lastStatus, lastStatusTs, locale, localization, methodSet, outbox, ps, ready, serviceClass, serviceType, serviceVersion, simpleName, statusBroadcastLimitMs, thisThread
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
void |
move(int x,
int y)
simulate moving the mouse cursor to the specified screen coordinates
|
void |
press(int keycode)
simulate pressing a mouse button (does NOT release the button!)
|
void |
press(int[] keycodes)
simulate pressing several mouse buttons (does NOT release the buttons!)
|
void |
pressAndRelease(int[] keycodes,
int duration)
simulate pressing and releasing several mouse buttns after the desired
duration The buttons are released in reverse order they were pressed.
|
void |
pressAndRelease(int keycode,
int duration)
simulate pressing and releasing a mouse button after the desired duration
|
void |
release(int keycode)
simulate releasing a mouse button (does NOT press the button!)
|
void |
release(int[] keycodes)
simulate releasing several mouse buttons (does NOT press the buttons!)
|
void |
releaseReversed(int[] keycodes)
simulate releasing several mouse buttons (does NOT press the buttons!)
Releases buttons in reversed order they were specified.
|
void |
wheel(int wheelAmt)
simulate rotating (/scrolling) the mouse wheel
|
addListener, addListener, addListener, addListener, addTask, addTask, addTask, addTaskOneShot, attach, attach, broadcast, broadcast, broadcastState, broadcastStatus, buildDna, buildDna, buildDnaKeys, buildDnaNames, clearLastError, close, containsTask, copyResource, copyShallowFrom, createPeer, createPeer, createRootReserved, detach, detach, detach, echoHeartbeat, error, error, error, export, export, exportAll, exportAll, getAttached, getCountry, getDataDir, getDataDir, getDataInstanceDir, getDeclaredMethodNames, getDeclaredMethods, getDescription, getDisplayLanguage, getDna, getDnaString, getFile, getFullName, getHomeDir, getHostName, getId, getInbox, getInstanceId, getIntanceName, getInterfaceSet, getLanguage, getLastError, getLocale, getLocaleTag, getMessageSet, getMetaData, getMethodMap, getMethodNames, getMethods, getMethodToolTip, getMsg, getName, getNotifyList, getNotifyListKeySet, getOutbox, getPeer, getPeerKey, getPeerName, getResource, getResource, getResource, getResourceAsString, getResourceAsString, getResourceAsString, getResourceDir, getResourceDir, getResourceDir, getResourceDir, getResourceDirList, getResourceDirList, getResourceImage, getResourceRoot, getRootDataDir, getServiceIcon, getServiceIcon, getServiceIcon, getServiceScript, getServiceScript, getServiceScript, getSimpleName, getSwagger, getTasks, getThisThread, getType, hasError, hasInternet, hasPeers, hasSubscribed, help, in, info, info, invoke, invoke, invoke, invokeOn, invokeOn, invokePeer, invokePeer, isAttached, isAttached, isDev, isHeadless, isLocal, isReady, isRunning, isRuntime, isVirtual, load, load, loadAndStart, loadFromJson, loadFromJson, loadLocalizations, localize, localize, logTimeEnable, mergeDna, mergeDna, mergePeerDna, movePeerDna, out, out, preProcessHook, preRoutingHook, preShutdown, publishError, publishQueueStats, publishState, publishStats, publishStatus, purgeTask, purgeTasks, releasePeer, releasePeers, releaseService, removeAllListeners, removeListener, removeListener, requiresSecurity, reserve, reserve, reserveRoot, reserveRoot, reserveRootAs, run, save, save, save, send, send, send, sendBlocking, sendBlocking, sendBlocking, sendBlocking, sendPeer, sendToPeer, sendToPeer, setId, setInstanceId, setLocale, setName, setOrder, setPeer, setReady, setSecurityProvider, setState, setThisThread, setVirtual, sleep, sleep, stackToString, startPeer, startPeer, startPeers, startService, stopService, subscribe, subscribe, subscribe, subscribeTo, subscribeToRuntime, toString, unsubscribe, unsubscribe, unsubscribe, unsubscribeTo, unsubscribeToRuntime, updateStats, warn, warn
public void pressAndRelease(int keycode, int duration)
keycode
- buttoncode of button (use InputEvent.VK_XXX, where XXX is your
button)duration
- key press duration in millisecondspublic void press(int keycode)
keycode
- buttoncode of button (use InputEvent.VK_XXX, where XXX is your
button)public void release(int keycode)
keycode
- buttoncode of button (use InputEvent.VK_XXX, where XXX is your
button)public void pressAndRelease(int[] keycodes, int duration)
keycodes
- array of buttoncodes of buttons (use InputEvent.VK_XXX, where XXX
is your button)duration
- key press duration in millisecondspublic void press(int[] keycodes)
keycodes
- array of buttoncodes of buttons (use InputEvent.VK_XXX, where XXX
is your button)public void release(int[] keycodes)
keycodes
- array of buttoncodes of buttons (use InputEvent.VK_XXX, where XXX
is your button)public void releaseReversed(int[] keycodes)
keycodes
- array of buttoncodes of buttons (use InputEvent.VK_XXX, where XXX
is your button)public void move(int x, int y)
x
- X-Positiony
- Y-Positionpublic void wheel(int wheelAmt)
wheelAmt
- rotation amount, negative amounts rotate "backwards"public static void main(String[] args)
Copyright © 2020 myrobotlab. All rights reserved.