← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #235431]: Select text by pressing SHIFT+END

 

Question #235431 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/235431

    Status: Open => Answered

jptlse proposed the following answer:
To select a string of text, perhaps could you try to use right and left arrow keys, like describe below.
This example is ok for Mac keyboard. You have to adapt it for Windows keyboard.

click("your image or text if ocr is activated")

# Push down the key command with left arrow
keyDown(Key.CMD)
type(Key.LEFT)

# "key command" is still pressed + right arrow is pressed
keyDown(Key.SHIFT)
type(Key.RIGHT)

# The entire the line is selected

# Remove "virtual fingers" from the keyboard :)
keyUp(Key.CMD)
keyUp(Key.SHIFT)

# Validate you've selected the line with a copy of the string and a prompt
type('c', KeyModifier.KEY_CMD)
popup(Env.getClipboard())

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.