mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
macos: reset double click when mouse is moved (#341)
This commit is contained in:
committed by
GitHub
parent
2d1a037eba
commit
f91b6bd3c1
@@ -88,7 +88,7 @@ impl MacOSEmulation {
|
||||
button_state,
|
||||
previous_button: None,
|
||||
previous_button_click: None,
|
||||
button_click_state: 1,
|
||||
button_click_state: 0,
|
||||
repeat_task: None,
|
||||
notify_repeat_task: Arc::new(Notify::new()),
|
||||
modifier_state: Rc::new(Cell::new(XMods::empty())),
|
||||
@@ -244,7 +244,8 @@ impl Emulation for MacOSEmulation {
|
||||
) -> Result<(), EmulationError> {
|
||||
log::trace!("{event:?}");
|
||||
match event {
|
||||
Event::Pointer(pointer_event) => match pointer_event {
|
||||
Event::Pointer(pointer_event) => {
|
||||
match pointer_event {
|
||||
PointerEvent::Motion { time: _, dx, dy } => {
|
||||
let mut mouse_location = match self.get_mouse_location() {
|
||||
Some(l) => l,
|
||||
@@ -395,7 +396,13 @@ impl Emulation for MacOSEmulation {
|
||||
};
|
||||
event.post(CGEventTapLocation::HID);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
// reset button click state in case it's not a button event
|
||||
if !matches!(pointer_event, PointerEvent::Button { .. }) {
|
||||
self.button_click_state = 0;
|
||||
}
|
||||
}
|
||||
Event::Keyboard(keyboard_event) => match keyboard_event {
|
||||
KeyboardEvent::Key {
|
||||
time: _,
|
||||
|
||||
Reference in New Issue
Block a user