#[repr(C)]pub struct MouseEventData {
pub position: LogicalPosition,
pub button: MouseButton,
pub buttons: u8,
pub modifiers: KeyModifiers,
pub source: PointerSource,
pub device_id: u64,
pub seat_id: u64,
}Expand description
Type-specific event data for mouse events.
Fields§
§position: LogicalPositionPosition of the mouse cursor
Which button was pressed/released
Bitmask of currently pressed buttons
modifiers: KeyModifiersModifier keys state
source: PointerSourceWhat produced this event. APPENDED for ABI stability.
device_id: u64Which physical device produced it, or 0 when the platform does not
say. APPENDED for ABI stability.
Only PenState, GamepadState and TabletPadState carried a device id
before, so a mouse event could not say WHICH of two mice moved — and
MouseState used to be a single global, which is why multi-seat (a
kiosk, a shared display, two people on one compositor) was not
expressible at all. The state fans out per seat since 9b-ii; this
field stays the PHYSICAL device, seat_id below says which cursor.
seat_id: u64Which pointer SEAT - which independent cursor - produced it. APPENDED
(9b-ii). PRIMARY_POINTER_SEAT (0) for the ordinary mouse, which is
every event on a platform with one cursor; an X11 MPX master id or a
Wayland seat otherwise. A callback that receives a non-zero value
reads that seat’s state through get_pointer_seat_state, because
get_current_mouse_state is the PRIMARY seat by definition.
Trait Implementations§
Source§impl Clone for MouseEventData
impl Clone for MouseEventData
Source§fn clone(&self) -> MouseEventData
fn clone(&self) -> MouseEventData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more