Use more than 3 mouse buttons

Asked by Vincent

Hey there,

I wonder if it's possible to use the other click of the mouse

The soft i'm using has many different click possible (Left Click = B1 / Right Click = B3 / middleClick = B2)

there are the 3 differents clicks are usable with click, rightClick ...

But on my mouse i need to use some other buttons (B4, B5 for example) and i wonder how can i use them or if i have to write a little function like i've done for the click B2 (middleClick) which is the WheelClick :

Click B2 =

#start

def middleClick(self, psmrl):
    try:
        psmrl = sel.find(psmrl).getTarget()
    except:
        pass
    hover(psmrl)
    mouseDown(Button.MIDDLE)
    mouseUp(Button.MIDDLE)

#end

Thanks for you answer
Vincent.

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
RaiMan (raimund-hocke) said :
#1

Not a feature in the current SikuliX implementation.

... but you might try to implement it using the Java Robot class (used by SikuliX internally).

the respective functions are
java.awt.Robot::mousePress(buttonMask)
java.awt.Robot::mouseRelease(buttonMask)

In a SikuliX script you can say:

input java.awt.Robot as JR
robot = new JR()
robot.mousePress(integerValue)
robot.mouseRelease(integerValue)

consult the respective Java documentation for details.

Can you help with this problem?

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

To post a message you must log in.