Giter Site home page Giter Site logo

joonasvali / naturalmousemotion Goto Github PK

View Code? Open in Web Editor NEW
206.0 8.0 58.0 149 KB

This library provides a way to move cursor to specified coordinates on screen reliably, while being randomly arced to look like real hand moved it there by using a mouse. The default settings should look good enough for most cases, but if user wishes, they can heavily customize the settings and implementations responsible for the trajectory of the cursor for specific use cases.

License: Other

Java 100.00%
java mouse motion cursor robot natural

naturalmousemotion's People

Contributors

dependabot[bot] avatar joonasvali avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

naturalmousemotion's Issues

IF mouse goes off canvas errors occur

I basically have a method that uses your lib and the method drags the mouse off of the screen.

Except for when that happens and I try to grab the mouse again it gives me these warnings and stops mouse movement.

`2020-07-13 16:16:37 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:37 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:37 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:37 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:38 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:38 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:38 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:38 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:38 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:38 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:39 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:39 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:39 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:39 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:40 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:40 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:40 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:40 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:41 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:41 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:41 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:41 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:42 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:42 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:42 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:42 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:43 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:43 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:43 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:43 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:44 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:44 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:44 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:44 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:44 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:44 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:45 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:45 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:45 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:45 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:45 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:45 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:46 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:46 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:46 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:46 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:47 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 
2020-07-13 16:16:47 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.
2020-07-13 16:16:47 [Script] WARN  c.g.j.naturalmouse.api.MouseMotion - Mouse off from step endpoint (adjustment was done) x: (22 -> 18) y: (0 -> 0) 

Click simulation

Hello
Just a confirmation, the library handles the mouse movements
For clicks and drag and drop what do you use ? Java robot ?

Would there be a way to cancel the attempt to 'repopulate the movement array'?

For my situation it just ends up spamming

'WARN c.g.j.naturalmouse.api.MouseMotion - Re-populating movement array. Did not end up on target pixel.'

Isn't there a way we could just reset the mouse location and continue on? or just continue on with the problems at the users risk; it is a warning notification after all.

If I restart the script it still uses the last mouse coordinates and it works again just fine; it just gets bottlenecked by attempting to fix this problem; when in reality I will direct the movement to fix itself.

Screen limits cause problems with multiple monitors

Currently the mouse movement is restricted with single screen device limits. This should probably be removed as then negative values would allow enter the monitor on the left and positive values over screen length the monitor on the right.

Feature request to restrict mouse movement

Thank you for the good work you have done. I really like the library.

I would like to limit mouse movement in certain area of the screen only. Its not clear from reading the code if it can be done or not.

My use case is kind of plotting points on a canvas. I just want to send events to my canvas area and ignore other parts of screen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.