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:
parent
6300cf915e
commit
4748890935
7 changed files with 67 additions and 9 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue