Free scroll the screen in Sikuli

Asked by Alex Cr

If you want to free scroll in the screen , using SIkuli, you might try these :

mouseMove(Location(100,100))
wait(1)
mouseDown(Button.LEFT)
wait(2)
mouseMove(Location(300,300))
wait(5)
#end free-scrolling

Any other ways to scroll the screen ?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
abuzer stream (abuzerstream) said :
#1

You can use dragDrop

dragDrop(PSMRL, PSMRL[, modifiers])
Perform a drag-and-drop operation from a starting click point to the target click point indicated by the two PSMRLs respectively.

Parameters:
PSMRL – a pattern, a string, a match, a region or a location that evaluates to a click point.
modifiers – one or more key modifiers
If one of the parameters is PS, the operation might fail due to not Found.

Sideeffect: when using PS, the match of the target can be accessed using Region.getLastMatch() afterwards. If only the first parameter is given as PS, this match is returned by Region.getLastMatch().

If the operation does not perform as expected (usually caused by timing problems due to delayed reactions of applications), you may adjust the internal timing parameters Settings.DelayBeforeMouseDown, Settings.DelayBeforeDrag and Settings.DelayBeforeDrop (default value is 0.3 seconds) for the next action (timing is reset to default after the operation is completed). In case this might be combined with the internal timing parameter Settings.MoveMouseDelay.

Note: If you need to implement more sophisticated mouse and keyboard actions look at Low Level Mouse and Keyboard Actions.

Can you help with this problem?

Provide an answer of your own, or ask Alex Cr for more information if necessary.

To post a message you must log in.