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 raw mouse events and format #699

Merged
merged 2 commits into from May 9, 2018

Conversation

Projects
None yet
5 participants
@Xaeroxe
Member

Xaeroxe commented May 8, 2018

Note to reviewers: The only part with any meaningful changes is the amethyst_input files. Everything else is formatting.

This change is Reviewable

@jojolepro

Thanks!

Kind of hard to read with the formatting changes... rustfmt-preview version?

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe May 8, 2018

Member

0.3.8-nightly (346238f4 2018-02-04)

Member

Xaeroxe commented May 8, 2018

0.3.8-nightly (346238f4 2018-02-04)

@MrMinimal

MrMinimal approved these changes May 8, 2018 edited

Looks good, works as expected!
I'll update the fly_camera demo accordingly.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe May 8, 2018

Member

Thanks @MrMinimal !

Member

Xaeroxe commented May 8, 2018

Thanks @MrMinimal !

@jojolepro

This comment has been minimized.

Show comment
Hide comment
@jojolepro

jojolepro May 8, 2018

Collaborator

I wonder if my graphics tablet would generate mouse moved events 🤔

Collaborator

jojolepro commented May 8, 2018

I wonder if my graphics tablet would generate mouse moved events 🤔

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe May 8, 2018

Member

You should try it!

Member

Xaeroxe commented May 8, 2018

You should try it!

@jojolepro

This comment has been minimized.

Show comment
Hide comment
@jojolepro

jojolepro May 8, 2018

Collaborator

doing that right now :P

Collaborator

jojolepro commented May 8, 2018

doing that right now :P

@MrMinimal

This comment has been minimized.

Show comment
Hide comment
@MrMinimal

MrMinimal May 8, 2018

Contributor

@jojolepro I just tried my Wacom on Linux X11 and it does produce events, but every delta is in the thousands even if I don't move. The mouse's delta is between -10 and +10.

Contributor

MrMinimal commented May 8, 2018

@jojolepro I just tried my Wacom on Linux X11 and it does produce events, but every delta is in the thousands even if I don't move. The mouse's delta is between -10 and +10.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe May 8, 2018

Member

@MrMinimal haha, that's bizarre. I hope gamers don't have these tablets plugged in while they're playing I guess

Member

Xaeroxe commented May 8, 2018

@MrMinimal haha, that's bizarre. I hope gamers don't have these tablets plugged in while they're playing I guess

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh May 8, 2018

Member

Device events will generally be quite different from device to device, it's one of the drawbacks of using the raw data. We should consider how to add scaling factors to different device types.

Member

Rhuagh commented May 8, 2018

Device events will generally be quite different from device to device, it's one of the drawbacks of using the raw data. We should consider how to add scaling factors to different device types.

@jojolepro

This comment has been minimized.

Show comment
Hide comment
@jojolepro

jojolepro May 8, 2018

Collaborator

I assume most games would want to have adjustments for that. Something like "put your pen in the bottom left, now in the top right" and it calculates the sensitivity accordingly. I have yet to find a 3d game made for mouse players that supports tablets at all (without needing the tablet driver to have a mouse emulation mode). Usually you want to use tablets for their absolute position input anyway.

A quick fix would be to let user set a custom sensitivity of 0.001 in the game's setting files.

Collaborator

jojolepro commented May 8, 2018

I assume most games would want to have adjustments for that. Something like "put your pen in the bottom left, now in the top right" and it calculates the sensitivity accordingly. I have yet to find a 3d game made for mouse players that supports tablets at all (without needing the tablet driver to have a mouse emulation mode). Usually you want to use tablets for their absolute position input anyway.

A quick fix would be to let user set a custom sensitivity of 0.001 in the game's setting files.

@MrMinimal

This comment has been minimized.

Show comment
Hide comment
@MrMinimal

MrMinimal May 9, 2018

Contributor

Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

Contributor

MrMinimal commented May 9, 2018

Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@jojolepro

This comment has been minimized.

Show comment
Hide comment
@jojolepro

jojolepro May 9, 2018

Collaborator

One more review from anyone = merge

Collaborator

jojolepro commented May 9, 2018

One more review from anyone = merge

@Rhuagh

Rhuagh approved these changes May 9, 2018

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe May 9, 2018

Member

bors r+

Member

Xaeroxe commented May 9, 2018

bors r+

bors bot added a commit that referenced this pull request May 9, 2018

Merge #699
699: Add raw mouse events and format r=Xaeroxe a=Xaeroxe

Note to reviewers: The only part with any meaningful changes is the amethyst_input files.  Everything else is formatting.


<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/amethyst/amethyst/699)
<!-- Reviewable:end -->


Co-authored-by: Jacob Kiesel <kieseljake@gmail.com>
@bors

This comment has been minimized.

Show comment
Hide comment

@bors bors bot merged commit a1bfe6d into amethyst:develop May 9, 2018

4 checks passed

bors Build succeeded
Details
code-review/reviewable 10 files reviewed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

mnivoliez pushed a commit to mnivoliez/amethyst that referenced this pull request May 12, 2018

mnivoliez
Squashed commit of the following:
commit 008fa48
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Sat May 12 17:20:24 2018 +0200

    Fix typo

commit 6cd96b7
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Sat May 12 15:15:31 2018 +0200

    Better documentation and correct some errors in documentation

commit a597dea
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Sat May 12 15:02:28 2018 +0200

    forgot to change component name everywhere.... (name is more consistent now)

commit e6a68ff
Merge: 476190d 108486f
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Sat May 12 14:54:46 2018 +0200

    Merge branch 'develop' into feature/#593-add-arc-ball-camera

commit 476190d
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Sat May 12 14:43:35 2018 +0200

    Add better documentation.

commit 108486f
Merge: 1d0dea9 7d8ad99
Author: bors[bot] <bors[bot]@users.noreply.github.com>
Date:   Thu May 10 20:23:38 2018 +0000

    Merge #702

    702: Use derivative default better r=Rhuagh,torkleyy a=Xaeroxe

    The redundancy of these bounds in the docs was bothering me.

    <!-- Reviewable:start -->
    ---
    This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/amethyst/amethyst/702)
    <!-- Reviewable:end -->

    Co-authored-by: Jacob Kiesel <kieseljake@gmail.com>

commit 1d0dea9
Merge: ca2edbe e3239a0
Author: bors[bot] <bors[bot]@users.noreply.github.com>
Date:   Thu May 10 19:42:29 2018 +0000

    Merge #701

    701: fix: Update shrev and affected dependencies after rewrite r=torkleyy,Xaeroxe,jojolepro a=Rhuagh

    <!-- Reviewable:start -->
    This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/amethyst/amethyst/701)
    <!-- Reviewable:end -->

    Co-authored-by: Simon Rönnberg <seamonr@gmail.com>

commit d58bc59
Merge: 4b73414 ca2edbe
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Thu May 10 12:47:16 2018 +0200

    Merge branch 'develop' into feature/#593-add-arc-ball-camera

commit 4b73414
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Thu May 10 12:39:35 2018 +0200

    The example now works fine.

commit e3239a0
Author: Simon Rönnberg <seamonr@gmail.com>
Date:   Wed May 9 14:24:04 2018 +0200

    feat: Reexport shrev from the core crate

commit 0d4ed1a
Author: Simon Rönnberg <seamonr@gmail.com>
Date:   Mon May 7 22:24:41 2018 +0200

    fix: Update shrev and affected dependencies after rewrite

commit 302be0a
Merge: ad6c587 c9fcb1f
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Thu May 10 12:00:32 2018 +0200

    Merge branch 'feature/#593-add-arc-ball-camera' of github.com:mnivoliez/amethyst into feature/#593-add-arc-ball-camera

commit 7d8ad99
Author: Jacob Kiesel <kieseljake@gmail.com>
Date:   Wed May 9 16:56:15 2018 -0600

    Use derivative default better

commit ad6c587
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Thu May 10 00:27:43 2018 +0200

    Get the switch back. Tomorrow I shall look into the quaternion and
    determination of new position based on it.

commit c9fcb1f
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Thu May 10 00:27:43 2018 +0200

    Add stuff.

commit f962b13
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Wed May 9 23:56:55 2018 +0200

    Add missing systems, still no result, the scene stay still, or at least
    seems to.

commit f7f3438
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Wed May 9 23:36:41 2018 +0200

    Add the example but I may not fully understand how the systems works
    since it seem not to move.

commit ca2edbe
Merge: 2f16546 a1bfe6d
Author: bors[bot] <bors[bot]@users.noreply.github.com>
Date:   Wed May 9 15:43:52 2018 +0000

    Merge #699

    699: Add raw mouse events and format r=Xaeroxe a=Xaeroxe

    Note to reviewers: The only part with any meaningful changes is the amethyst_input files.  Everything else is formatting.

    <!-- Reviewable:start -->
    This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/amethyst/amethyst/699)
    <!-- Reviewable:end -->

    Co-authored-by: Jacob Kiesel <kieseljake@gmail.com>

commit 2add465
Merge: 04699e9 e03052c
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Wed May 9 00:34:55 2018 +0200

    Merge branch 'feature/#593-add-arc-ball-camera' of github.com:mnivoliez/amethyst into feature/#593-add-arc-ball-camera

commit 04699e9
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Wed May 9 00:23:43 2018 +0200

    Change the system to just correct distance between cam and target. The
    free rotation will take care of the rest. Thanks to @jojolepro for the
    heads up.

commit e03052c
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Wed May 9 00:23:43 2018 +0200

    Change the system to just correct distance between cam and target. The
    free rotation will take care of the rest. Thanks to @jojolepro for the
    heads up.

commit a1bfe6d
Author: Jacob Kiesel <kieseljake@gmail.com>
Date:   Tue May 8 13:42:02 2018 -0600

    Improve wording on docs

commit b3ff7f7
Merge: d76fd92 542e9ec
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Tue May 8 21:18:19 2018 +0200

    Merge branch 'feature/#593-add-arc-ball-camera' of github.com:mnivoliez/amethyst into feature/#593-add-arc-ball-camera

commit d76fd92
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Tue May 8 21:07:59 2018 +0200

    Issue #593

    As a arc ball mecanism was wanted, a component indicated the target and
    a system making the calculus for it was needed.

    Tose two elements are now reality but need testing. One way to do so is
    to provide a solid exemple of the mecanism. Also, maybe some tests could
    be implemented.

commit 542e9ec
Author: mnivoliez <mathieu.nivoliez@laposte.net>
Date:   Tue May 8 21:07:59 2018 +0200

    Issue #593

    As a arc ball mecanism was wanted, a component indicated the target and
    a system making the calculus for it was needed.

    Tose two elements are now reality but need testing. One way to do so is
    to provide a solid exemple of the mecanism. Also, maybe some tests could
    be implemented.

commit 30a8915
Author: Jacob Kiesel <kieseljake@gmail.com>
Date:   Tue May 8 09:41:19 2018 -0600

    Add raw mouse events and format

commit 2f16546
Merge: cec1f82 1739042
Author: bors[bot] <bors[bot]@users.noreply.github.com>
Date:   Tue May 8 14:46:25 2018 +0000

    Merge #698

    698: winit 1.13.1 upgrade r=Xaeroxe a=illis

    Fixes #655 (have tested on my Arch Linux machine).

    According to the [winit changelog](https://github.com/tomaka/winit/blob/master/CHANGELOG.md) ios needs to be handled slightly differently (I haven't tested this).

    Note from Xaeroxe:
    Fixes amethyst#515

    <!-- Reviewable:start -->
    ---
    This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/amethyst/amethyst/698)
    <!-- Reviewable:end -->

    Co-authored-by: p <parimal@beyond8labs.com>

commit cec1f82
Merge: 9eefa6e d5b6fd8
Author: bors[bot] <bors[bot]@users.noreply.github.com>
Date:   Tue May 8 14:04:04 2018 +0000

    Merge #697

    697: Re-use vec allocation for event compression r=Rhuagh a=Xaeroxe

    If event compression was causing any noticeable  performance impact it'll be gone after merging this PR.

    <!-- Reviewable:start -->
    ---
    This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/amethyst/amethyst/697)
    <!-- Reviewable:end -->

    Co-authored-by: Jacob Kiesel <kieseljake@gmail.com>

commit 1739042
Author: p <parimal@beyond8labs.com>
Date:   Tue May 8 23:29:59 2018 +1200

    Update examples to use CloseRequested instead of Closed

commit 7768c83
Author: p <parimal@beyond8labs.com>
Date:   Tue May 8 20:06:13 2018 +1200

    Handle ios WindowEvent::Destroyed

commit 2ff58bf
Author: p <parimal@beyond8labs.com>
Date:   Tue May 8 14:16:11 2018 +1200

    Upgrade winit to v1.13.1 and glutin to v0.15

commit d5b6fd8
Author: Jacob Kiesel <kieseljake@gmail.com>
Date:   Mon May 7 10:40:07 2018 -0600

    Provide initial capacity for event vec

commit 29359dd
Author: Jacob Kiesel <kieseljake@gmail.com>
Date:   Mon May 7 09:05:57 2018 -0600

    Re-use vec allocation for event compression

@Xaeroxe Xaeroxe deleted the Xaeroxe:input branch May 14, 2018

bors bot added a commit that referenced this pull request May 19, 2018

Merge #705
705: Change fly_camera example to use winit's DeviceEvent r=Xaeroxe a=MrMinimal

Following #699 this PR focuses on implementing raw mouse input for the fly_camera example.
It replaces the mouse input relative to cursor position with raw mouse input (which also sends values even if the cursor does not move).
This might fix #636 but I'd have to test that.

Also the mouse cursor is not forcibly centered every frame, but instead winit's `CursorState::Grab` is used.

I have only tested this on Windows 10 so far, not sure if the movement is still framerate dependent.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/amethyst/amethyst/705)
<!-- Reviewable:end -->


Co-authored-by: Tom Langwaldt <t.langwaldt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment