-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mouse.click method throws exception with null location #299
Comments
I mean, I don't want to send mouse move message to Windows, which i'm working with. |
Not really sure, what you want. ... but a possible null-parameter should be checked before used and throw an IllegalArgumentException to point at the problem (not only NPE). Mouse.click() is intended to click at the given location. If you want to click at the current position of the mouse pointer: |
I have next code
When run it, if I'll hook Windows messages (posted by Windows after Sikulix has send input messages to it) , I receive MouseMove event, followed by MouseDown and MouseUp.
method's code
The reason to do it is to prevent confusing, because it is unexpected that mouse will move when clicking at its current position. |
Hi!
There is a
method in the Mouse class (247 line). It has check for necessity of mouse moving
Well, if the
loc
isnull
, mouse won't move. That is exactly what I want. However, when I'm trying to pass thenull
value to themethod (Mouse class, 192 line), that calls previously mentioned
protected
method and can be called outside of this class, it throwsjava.lang.NullPointerException
, because it immediately callsloc.isOtherScreen()
Should there be check for
null
?The text was updated successfully, but these errors were encountered: