pub struct MouseDevice { /* private fields */ }Expand description
Represents a mouse device: turns raw pointer events into routed pointer events on the element under the pointer or capturing it.
Implementations§
Source§impl MouseDevice
impl MouseDevice
Sourcepub fn new() -> Rc<MouseDevice>
pub fn new() -> Rc<MouseDevice>
Creates a mouse device with a pointer of its own.
Sourcepub fn with_pointer(pointer: Rc<Pointer>) -> Rc<MouseDevice>
pub fn with_pointer(pointer: Rc<Pointer>) -> Rc<MouseDevice>
Creates a mouse device for an existing pointer.
Sourcepub fn primary() -> Rc<MouseDevice>
pub fn primary() -> Rc<MouseDevice>
The primary mouse device of the current thread, created on first use.
Sourcepub fn reset_primary_for_unit_tests()
pub fn reset_primary_for_unit_tests()
Forgets the primary mouse device, so that tests start with a fresh one.
Sourcepub fn platform_capture_lost(&self)
pub fn platform_capture_lost(&self)
Notifies the device that the capture of its pointer was lost in the platform.
Trait Implementations§
Source§impl IInputDevice for MouseDevice
impl IInputDevice for MouseDevice
Source§fn process_raw_event(&self, e: &dyn IRawInputEventArgs)
fn process_raw_event(&self, e: &dyn IRawInputEventArgs)
Processes raw event. Is called after preprocessing by the input
manager.
Source§fn as_pointer_device(&self) -> Option<&dyn IPointerDevice>
fn as_pointer_device(&self) -> Option<&dyn IPointerDevice>
The device as a pointer device, if it is one.
impl IMouseDevice for MouseDevice
Source§impl IPointerDevice for MouseDevice
impl IPointerDevice for MouseDevice
Source§fn try_get_pointer(&self, _ev: &RawPointerEventArgs) -> Option<Rc<dyn IPointer>>
fn try_get_pointer(&self, _ev: &RawPointerEventArgs) -> Option<Rc<dyn IPointer>>
Gets a pointer for specific event args. Read more
Auto Trait Implementations§
impl !Freeze for MouseDevice
impl !RefUnwindSafe for MouseDevice
impl !Send for MouseDevice
impl !Sync for MouseDevice
impl !UnwindSafe for MouseDevice
impl Unpin for MouseDevice
impl UnsafeUnpin for MouseDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more