mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
Add MouseButton::{Back, Forward} to MouseInput
Add named variants for physical back and forward keys which could be found on some mice. The macOS bits may not work on all the hardware given that apple doesn't directly support such a thing. Co-authored-by: daxpedda <daxpedda@gmail.com>
This commit is contained in:
@@ -579,7 +579,7 @@ impl<T: 'static> EventProcessor<T> {
|
||||
|
||||
use crate::event::{
|
||||
ElementState::{Pressed, Released},
|
||||
MouseButton::{Left, Middle, Other, Right},
|
||||
MouseButton::{Back, Forward, Left, Middle, Other, Right},
|
||||
MouseScrollDelta::LineDelta,
|
||||
Touch,
|
||||
WindowEvent::{
|
||||
@@ -651,6 +651,23 @@ impl<T: 'static> EventProcessor<T> {
|
||||
}
|
||||
}
|
||||
|
||||
8 => callback(Event::WindowEvent {
|
||||
window_id,
|
||||
event: MouseInput {
|
||||
device_id,
|
||||
state,
|
||||
button: Back,
|
||||
},
|
||||
}),
|
||||
9 => callback(Event::WindowEvent {
|
||||
window_id,
|
||||
event: MouseInput {
|
||||
device_id,
|
||||
state,
|
||||
button: Forward,
|
||||
},
|
||||
}),
|
||||
|
||||
x => callback(Event::WindowEvent {
|
||||
window_id,
|
||||
event: MouseInput {
|
||||
|
||||
Reference in New Issue
Block a user