backend: add ButtonState
This commit is contained in:
parent
e22e6680b6
commit
0e1be7544f
17 changed files with 75 additions and 66 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use {
|
||||
crate::{
|
||||
backend::{AxisSource, InputEvent, KeyState, ScrollAxis},
|
||||
backend::{AxisSource, ButtonState, InputEvent, KeyState, ScrollAxis},
|
||||
backends::metal::MetalBackend,
|
||||
fixed::Fixed,
|
||||
ifs::wl_seat::tablet::{
|
||||
|
|
@ -216,12 +216,12 @@ impl MetalBackend {
|
|||
if dev.pressed_buttons.insert(event.button(), ()).is_some() {
|
||||
return;
|
||||
}
|
||||
KeyState::Pressed
|
||||
ButtonState::Pressed
|
||||
} else {
|
||||
if dev.pressed_buttons.remove(&event.button()).is_none() {
|
||||
return;
|
||||
}
|
||||
KeyState::Released
|
||||
ButtonState::Released
|
||||
};
|
||||
dev.event(InputEvent::Button {
|
||||
time_usec: event.time_usec(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue