robotframework-SikuliLibrary
robotframework-SikuliLibrary copied to clipboard
[117] Added keywords KeyUp, KeyDown MouseMove on region and location
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
@rainmanwy , can you please review and if feel good for the project merge it ? Thanks.
@rajeshtaneja , so you replace the old "mouse move" implementation. right? could you name your "mouse move" to other keyword name? Thank you very much!
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.
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
@rajeshtaneja Hai I m vignesh currently I m working testing so pls your contect number
Sorry guys, was not keeping an eye on this. Will update patch soon. Thanks. @Vigneshbecse how can I help ?
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