0

Is it possible to (in sikuli/java) to make a right click event form a shift click and disregard what would normally happen with the right click?

Thanks,

Odin

Odinulf
  • 571
  • 2
  • 7
  • 18

1 Answers1

0

You can try to create a Sikuli wrapper that would "overwrite" the right click method. If you would then use your wrapper, all your scripts would do shift click instead of right click.

sikuliwrapper.py

...
from sikuli.Sikuli import Region as SikuliRegion
...

class Region(SikuliRegion, BaseLogger):

    def rightClick(self, target, modifiers=0):
        try:
            keyDown(Key.SHIFT)
            SikuliRegion.click(self, target, modifiers)
            KeyUp(Key.SHIFT)
        except FindFailed, e:   
            raise e

So whenever you will have for example

myreg = Region(0,0,300,300)
myreg.rightClick("pattern.png")

you will actually perform a Shift Click on the image.

Hope I understood what you wanted correctly. More info on how to write a wrapper for sikuli here: http://blog.mykhailo.com/2011/02/how-to-sikuli-and-robot-framework.html#step3

Radu Enea
  • 27
  • 7