#[repr(C)]pub enum MouseEvent {
Pressed {
position: LogicalPoint,
button: PointerEventButton,
click_count: u8,
is_touch: bool,
},
Released {
position: LogicalPoint,
button: PointerEventButton,
click_count: u8,
is_touch: bool,
},
Moved {
position: LogicalPoint,
is_touch: bool,
},
Wheel {
position: LogicalPoint,
delta_x: Coord,
delta_y: Coord,
phase: TouchPhase,
},
DragMove(DropEvent),
Drop(DropEvent),
PinchGesture {
position: LogicalPoint,
delta: f32,
phase: TouchPhase,
},
RotationGesture {
position: LogicalPoint,
delta: f32,
phase: TouchPhase,
},
Exit,
}Expand description
A mouse or touch event
The only difference with crate::platform::WindowEvent is that it uses untyped Point
TODO: merge with platform::WindowEvent
Variants§
Pressed
The mouse or finger was pressed
Fields
position: LogicalPointThe position of the pointer when the event happened.
The button that was pressed.
Released
The mouse or finger was released
Fields
position: LogicalPointThe position of the pointer when the event happened.
The button that was released.
Moved
The position of the pointer has changed
Fields
position: LogicalPointThe new position of the pointer.
Wheel
Wheel was operated.
Fields
position: LogicalPointThe position of the pointer when the event happened.
phase: TouchPhaseThe gesture phase reported for the wheel event.
DragMove(DropEvent)
The mouse is being dragged over this item.
InputEventResult::EventIgnored means that the item does not handle the drag operation
and InputEventResult::EventAccepted means that the item can accept it.
Drop(DropEvent)
The mouse is released while dragging over this item.
PinchGesture
A platform-recognized pinch gesture (macOS/iOS trackpad, Qt).
Fields
position: LogicalPointThe focal position of the gesture.
phase: TouchPhaseThe gesture phase reported by the platform.
RotationGesture
A platform-recognized rotation gesture (macOS/iOS trackpad, Qt).
Fields
position: LogicalPointThe focal position of the gesture.
phase: TouchPhaseThe gesture phase reported by the platform.
Exit
The mouse exited the item or component
Implementations§
Source§impl MouseEvent
impl MouseEvent
Sourcepub fn position(&self) -> Option<LogicalPoint>
pub fn position(&self) -> Option<LogicalPoint>
The position of the cursor for this event, if any
Sourcepub fn translate(&mut self, vec: LogicalVector)
pub fn translate(&mut self, vec: LogicalVector)
Translate the position by the given value
Sourcepub fn transform(&mut self, transform: ItemTransform)
pub fn transform(&mut self, transform: ItemTransform)
Transform the position by the given item transform.
Trait Implementations§
Source§impl Clone for MouseEvent
impl Clone for MouseEvent
Source§fn clone(&self) -> MouseEvent
fn clone(&self) -> MouseEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more