Right click + Shift

Asked by DH

Hi,
how can I combine right click + Shift?

I can trigger right click.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
DH
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

From https://sikulix-2014.readthedocs.io/en/latest/region.html#Region.rightClick

rightClick(PSMRL[, modifiers])
Perform a mouse click on the click point using the right button.

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
Returns:
   the number of performed right clicks (actually 1). A 0 (integer null) means that because of some reason, no click could be performed (in case of PS may be not Found).

Side Effect if PS was used, the match can be accessed using Region.getLastMatch() afterwards.

Use KEY_SHIFT as value for "modifiers", see also https://sikulix-2014.readthedocs.io/en/latest/keys.html

Revision history for this message
DH (dh72) said :
#2

Hmm I don't understand.

I can't figure out how to combine

myEdge = find("edgeIcon.png")
rightClick(myEdge)

That works just fine.

But I need to right click + Key.SHIFT

Revision history for this message
masuo (masuo-ohara) said :
#3

keyDown(Key.SHIFT)
rightClick("image.png")
keyUp(Key.SHIFT)

https://sikulix-2014.readthedocs.io/en/latest/region.html?highlight=KeyDown#Region.keyDown

Revision history for this message
DH (dh72) said :
#4

Thanks, Now I understand how I can combine.
:-)

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

or

rightClick("image.png", KEY_SHIFT)