Don't change cursor on mouse move while mouse button is held down

This commit is contained in:
Max Brunsfeld
2021-08-27 10:34:11 -07:00
parent 5e6e0c68cd
commit 5262dcd3cb
4 changed files with 31 additions and 18 deletions
+1
View File
@@ -24,5 +24,6 @@ pub enum Event {
},
MouseMoved {
position: Vector2F,
left_mouse_down: bool,
},
}
+3 -2
View File
@@ -6,8 +6,8 @@ use cocoa::appkit::{
NSUpArrowFunctionKey as ARROW_UP_KEY,
};
use cocoa::{
appkit::{NSEvent as _, NSEventModifierFlags, NSEventType},
base::{id, YES},
appkit::{NSEvent, NSEventModifierFlags, NSEventType},
base::{id, nil, YES},
foundation::NSString as _,
};
use std::{ffi::CStr, os::raw::c_char};
@@ -116,6 +116,7 @@ impl Event {
native_event.locationInWindow().x as f32,
window_height - native_event.locationInWindow().y as f32,
),
left_mouse_down: NSEvent::pressedMouseButtons(nil) & 1 != 0,
}),
_ => None,
}