[2.0.5] Ubuntu: Mouse not useable (blocked)

Asked by Radek

Hello,
I am trying to take a scroll bar by left mouse button and scroll down on page. I took a code from Raimund's post from 2012.

r = Region(2400,0,1450,1050)
# drag
mouseDown(Button.LEFT)
wait(0.5)
mouseMove(r.left(1).below(100))
wait(0.5)
#drop
mouseUp(Button.LEFT)

Unfortunately every time I use any command with mouse, I see following error:

[error] Mouse.down(): Mouse not useable (blocked)
[error] Mouse.move(): Mouse not useable (blocked)
[error] Mouse.up(): Mouse not useable (blocked)

Other actions by mouse like "click or hover" are working fine.

My machine is Ubuntu 20.04.3 LTS, Java11 and Sikuli-IDE 2.0.5.

Could you please advise some workaround.
Thanks

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

You have to first be sure, that mouse actions work on a normal app (like a browser).

simply bring a window to foreground in middle of screen and run one liner

click()

if this does not work either, then please run the IDE from a terminal window with -v -c and send me the log output to my mail.

Revision history for this message
Radek (radek-manda) said :
#2

Hi Raimund, all the script actions are done in Chrome and "click" is working normal.

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

Then you have to check, why the programmed mouse actions (Java AWT Robot) might be blocked by the offending app/gui.

On Windows it sometimes help to run a script as admin from command line in such situations.

Revision history for this message
Radek (radek-manda) said :
#4

I am aware that you are mainly supporting Win and Mac (and I am on Ubuntu). Thank you very much that you are anyway trying to help.

But I am really lost, I did really lot of tests, but no idea why mouse commands are all the time only with error.

I moved the mouse from docking station to laptop directly ... same
I tried three different mouses on different technologies ... same
I tried three different screen resolutions 3840x2160 normally used, 2560x1440, 1600x1200 ...same
I tried script with one line only "mouseDown(Button.LEFT)" ... same
I tried script with one line only "click(different pictures)" ... mouse is normally moving and working on any picture
Three times restart across the fact that this is not needed on Linux ... same
Running Sikuli as only one application after restart ... same
Browser type is not playing any role as one line script without picture also making error

and than running script under root and ... Voila ... no error (very strange, because all the time I am using only my account on all actions/installations ...)

Could you please explain me more about why? What I should do to run a script with normal account, because when starting script under root there were some other errors in command line:

[error] FileManager: writeStringToFile: did not work: /root/.Sikulix/SikulixStore/lastUsedJar.txt
/root/.Sikulix/SikulixStore/lastUsedJar.txt (No such file or directory)

Probably I need to reinstall under root, right?

Thanks and Regards,
Radek

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

I am really sorry not being able to help you.

I do not have a real Ubuntu system available, only one running in VBox, which behaves different especially towards the Java AWT robot features.

What I do not understand: you say click() works, but not mouseMove() --- that's really odd.

Revision history for this message
Arthur Belmonte (art-belmonte) said :
#6

Hi Raimund,

I'm also having the same exact issue using a Mac running BigSur v11.6 when I use the wheel(WHEEL_UP or WHEEL_DOWN) command.

I execute the following script in the Google Chrome browser. Other actions such as click(), type(), and wait() works fine.
The Terminal also has permission to Accessibility and Screen Recording.

I run the SikuliX IDE using the following command in Terminal: java -jar /Applications/sikulixide-2.0.5-mac.jar

This is the script:
click("1634882245120.png")
wait(Setting.wait3)
wheel(WHEEL_DOWN,8)
wheel(WHEEL_UP,8)

This is the logs:
[log] CLICK on L[753,420]@S(0) (520 msec)
[error] Mouse.wheel(): Mouse not useable (blocked)
[error] Mouse.wheel(): Mouse not useable (blocked)

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

@ Arthur Belmonte (art-belmonte)
tested different aspects of Mouse actions on macOS 11.6 with Java 11 and 17 (recommended LTS Java's) using 2.0.5 and could not reproduce this behaviour even with Chrome.
It simply works.

BTW:
--- I'm also having the same exact issue
Since that is not true, you should have posted a new question yourself. Thank you.

Revision history for this message
Radek (radek-manda) said :
#8

Hi,
Unfortunatelly what I wrote before is not a root cause. After several times running the same script under sudo rights issue is back. Same message:
[error] Mouse.move(): Mouse not useable (blocked)
Without any visible reason. Same script was running 5 times smoothly during last hour.
Any idea is welcome.
Regards,
Radek

Can you help with this problem?

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

To post a message you must log in.