Skip to content

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

Merged
obv-mikhail merged 3 commits intoobv-mikhail:developfrom
benediktwerner:patch-3
Aug 26, 2020
Merged

Add MouseCursor::pos and fix move_rel and mov_abs#22
obv-mikhail merged 3 commits intoobv-mikhail:developfrom
benediktwerner:patch-3

Conversation

@benediktwerner
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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