[1.1.0] paste() without a target should not click

Bug #1428056 reported by Johannes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Committed
Critical
RaiMan

Bug Description

When I run my script with the version 1.0.1 and with the IDE 1.1.0 everything works fine. But I also run my scipt via JythonScriptRunner from Java. If I want to paste some text on the current caret position (and replace the selected text), sikuli does a click on the current mouse position and after that it paste the text. So my caret is on another position or my marked text isn't selected anymore before the new test will be inserted.

I looked up in the source code and the commit eba537c in Mouse.java Line 236 was the reason.

Tags: 1.1.0 sikuli
Revision history for this message
RaiMan (raimund-hocke) wrote :

Just to be clear: we are talking about something like that:
# having done some mouse actions to select a text
paste("new text")

If this is what you mean, then I have to confirm:
before pasting, it does a click at the current mouse position, which indeed does not really makes sense.
(but the place to fix this is in Region.paste(target, text), that should not do a click, if target is null).

But this should happen in any case, no matter wether you run the script with version 1.1.0 from IDE, command line or from Java.
So this needs clarification.

Changed in sikuli:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
summary: - paste() without a region do a click [1.1.0]
+ [1.1.0] paste() without a target should not click
Changed in sikuli:
importance: High → Critical
Revision history for this message
Johannes (johannes-wuebbeling) wrote :

Yes, often I select text:
# click in a text field
type("a", KeyModifier.CTRL)
paste("new text")

And yes, you are right, that this should be fixed in Region.paste and not in Mouse.java

I don't know why it works when I run the script from the IDE. I couldn't debug the IDE.

Revision history for this message
RaiMan (raimund-hocke) wrote :

might be, that the IDE is not the latest 1.1.0 or even 1.0.1?

Revision history for this message
Johannes (johannes-wuebbeling) wrote :

No, it's the versio "SikulixIDE 1.1.0 (2015-01-16_01:00nightly)"

Revision history for this message
RaiMan (raimund-hocke) wrote :

ok, then from IDE or Java should be the same.

The only thing I could imagine: running from IDE there might be differences in focus handling against the pure Java situation.

I will try to check that.

BTW: Windows or Linux?

Revision history for this message
Johannes (johannes-wuebbeling) wrote :

Windows 7, Java 1.7.0_65 64Bit

Thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.