robotframework-SikuliLibrary icon indicating copy to clipboard operation
robotframework-SikuliLibrary copied to clipboard

[117] Added keywords KeyUp, KeyDown MouseMove on region and location

Open rajeshtaneja opened this issue 5 years ago • 7 comments

We need some low level keywords for keeping key press down and mouse move at certain location. To achieve this we need following keywords:

KeyUp KeyDown MouseMoveRegion MouseMoveLocation

rajeshtaneja avatar Dec 09 '19 12:12 rajeshtaneja

@rainmanwy , can you please review and if feel good for the project merge it ? Thanks.

rajeshtaneja avatar Feb 03 '20 05:02 rajeshtaneja

@rajeshtaneja , so you replace the old "mouse move" implementation. right? could you name your "mouse move" to other keyword name? Thank you very much!

rainmanwy avatar Feb 04 '20 07:02 rainmanwy

A Mouse Move Offset would be a nice addition as well. I don't think that would be too much to add to this. To be used like this: Mouse Move Offset | x | y So wherever the mouse is at the time of this call, it moves x and y pixels from there.

stinnett-casey avatar Apr 15 '21 19:04 stinnett-casey

For anyone else looking for how to have these options until they get merged, here is a solution I found in the meantime: I wrote a custom python file with these things as custom keywords and imported both the keyboard and the mouse module. You can easily combine those to do these things. You can hold a key pressed: keyboard.press('alt') , sleep for a bit so it doesn't go too fast (time.sleep(.2)), then click: mouse.click(), then release the key: keyboard.release('alt').

You can also use mouse.move to move relative to the cursor's position or straight to some x,y coords. Here are the docs: https://github.com/boppreh/mouse https://github.com/boppreh/keyboard

Here is one of the keywords I made, as an example: def key_with_click(key, mouseBtn): keyboard.press(key) time.sleep(.2) mouse.click(mouseBtn) time.sleep(.2) keyboard.release(key)

Call in Robot file like this: Key With Click alt left

stinnett-casey avatar Apr 21 '21 22:04 stinnett-casey

@rajeshtaneja Hai I m vignesh currently I m working testing so pls your contect number

Vigneshbecse avatar May 10 '21 14:05 Vigneshbecse

Sorry guys, was not keeping an eye on this. Will update patch soon. Thanks. @Vigneshbecse how can I help ?

rajeshtaneja avatar May 12 '21 03:05 rajeshtaneja

I have copied the code over, fixed the spelling of "coordinates", and made the change to "mouse move region" instead of "mouse move" so there is no conflict. It is ready to be merged if approved: #154

stinnett-casey avatar Jun 17 '21 19:06 stinnett-casey