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

Side mouse buttons only recognized on initial input #2563

Closed
Satellile opened this issue Nov 21, 2022 · 1 comment · Fixed by #2565
Closed

Side mouse buttons only recognized on initial input #2563

Satellile opened this issue Nov 21, 2022 · 1 comment · Fixed by #2565

Comments

@Satellile
Copy link

Satellile commented Nov 21, 2022

In Bevy 0.9, I am watching for Mouse5 or Mouse4 to be pressed using MouseButton::Other(32) and MouseButton::Other(64).

However, it only recognizes the input on the first press, and then proceeds to no longer recognize the input. Left click works fine.

The code I used in Bevy 0.9 to watch for mouse input follows:

fn watch_for_mouse_input(mouse: Res<Input<MouseButton>>) {
    if mouse.just_pressed(MouseButton::Other(64)) { println!("Detected input 'Mouse5'!"); }
    if mouse.just_pressed(MouseButton::Other(32)) { println!("Detected input 'Mouse4'!"); }
    if mouse.just_pressed(MouseButton::Left)      { println!("Detected input 'Left Click'!"); }
}

And the output in console (comparing when the input is recognized vs the MouseEventInput stream from Bevy) is attached in this screenshot:
November 21 1337_WindowsTerminal
Notice how after Mouse4 and Mouse5 being recognized once, subsequent presses are no longer recognized.

It seems that, when releasing mouse4 or mouse5, it is being recognized as MouseButton:Other(0) rather than 32 or 64, and so MouseButton::Other(32) and 64 are not being recognized as being released.

If I hold mouse4 (32), then hold mouse5 (64) at the same time, it says that MouseButton::Other(96) has been pressed. If I release mouse4, it says MouseButton::Other(64) has been released, and then the next time I press Mouse5, it is recognized one time.

My apologizes if this is not actually a winit issue; I'm not sure if this should be reported here or in the Bevy github somewhere.

I'm running Windows 10.

@madsmtm
Copy link
Member

madsmtm commented Nov 22, 2022

I suspect this will be fixed by #2565 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants