Skip to content
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

Add MouseCursor::pos and fix move_rel and mov_abs #22

Merged
merged 3 commits into from
Aug 26, 2020

Conversation

benediktwerner
Copy link
Contributor

@benediktwerner benediktwerner commented Aug 22, 2020

As discussed in #16.

Not sure if the name is good. Maybe get_pos would be better?

Also, the MouseCursor functions taking self is a bit awkward. Maybe it would be better to just make them associated methods? Or at least make it Copy?

Edit: Also, I'm using MaybeUninit since I saw it used somewhere else in the code but I just realized that the other place is using MaybeUninit::zeroed. I think it should be safe as is and maybe even slightly better for performance (although the difference is probably minimal) but if you want I can change it. Also, maybe it would be clearer (and work in earlier Rust versions?) to use std::mem::zeroed()?

Edit2: Closes #16

@obv-mikhail
Copy link
Owner

Just pos seems fine to me.

Yeah, the self should probably be removed for the MouseCursor functions..

I am ok with any option for for the point.

@benediktwerner
Copy link
Contributor Author

Ok, I removed the self from the MouseCursor and MouseWheel methods for both the windows and Linux implementations and also updated the example and README.

I think this should be everything now. Keep in mind that this PR is full of breaking changes so the next release should increase the version appropriately, probably to 0.5.0.

@obv-mikhail obv-mikhail merged commit d64091f into obv-mikhail:develop Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible inaccuracy with move_abs on Win10
2 participants