[1.0.1] mouseDown(Button.LEFT) is not working

Asked by Eugene S

Hi all,

I am trying to perform the following operation (just simple left mouse button click):
mouseDown(Button.LEFT)

However, when I run the script with this command, I receive the following error:
[error] NameError ( name 'Button' is not defined)

This seems to be a very basic low level mouse functionality and since I haven't found such issue already discussed here, I assume that there is something I am missing?

Any ideas?

Thanks!
Eugene S

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Test (c4456517) said :
#1

What code appears before/after the mouseDown() call?

Revision history for this message
obiwan-92 (obiwan-92) said :
#2

Hello,

Try to add :
from sikuli import *
just in case or the import of sikuli was not done.
And be sure you aren't overwrite the class Button.

Regards.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

Depending on the version you are using, the Button constants might not be imported .

In case, comment #2 does not work, use
16 instead of Button.LEFT
4 instead of Button.RIGHT

Revision history for this message
Eugene S (shragovich) said :
#4

Hi RaiMan,

I am using the last version (1.0.1).
I have tried using the numbers instead of the constants and it worked!
Thanks!

Is that a bug? If it is, I can report it.

Thanks,
Eugene

Revision history for this message
RaiMan (raimund-hocke) said :
#5

When using the IDE, look in the about splash. this should say 12SEP... in the time stamp.

Or run from command line with option -d 3. the startup debug messages also should have these timestamps.

I checked with this version: ok

Revision history for this message
Eugene S (shragovich) said :
#6

Thanks RaiMan, that solved my question.