pub enum ShellEvent {
CursorMoved {
position: Point,
},
MouseInput {
position: Point,
button: MouseButton,
pressed: bool,
modifiers: KeyModifiers,
},
Wheel {
position: Point,
delta: Point,
modifiers: KeyModifiers,
},
ModifiersChanged(KeyModifiers),
Keyboard {
key: KeyCode,
pressed: bool,
repeat: bool,
modifiers: KeyModifiers,
},
Focused(bool),
Ime(ImeEvent),
}Expand description
平台无关输入事件 —— 桌面 shell 把原生事件翻译成此类型后再交给应用。
坐标语义:全部为 root layer 逻辑坐标(已按 DPR 换算)。
Variants§
CursorMoved
MouseInput
Wheel
滚轮/触控板:delta 已归一化为逻辑像素(约 16px/行)。
ModifiersChanged(KeyModifiers)
Keyboard
Focused(bool)
Ime(ImeEvent)
Trait Implementations§
Source§impl Clone for ShellEvent
impl Clone for ShellEvent
Source§impl Debug for ShellEvent
impl Debug for ShellEvent
Source§impl PartialEq for ShellEvent
impl PartialEq for ShellEvent
impl StructuralPartialEq for ShellEvent
Auto Trait Implementations§
impl Freeze for ShellEvent
impl RefUnwindSafe for ShellEvent
impl Send for ShellEvent
impl Sync for ShellEvent
impl Unpin for ShellEvent
impl UnsafeUnpin for ShellEvent
impl UnwindSafe for ShellEvent
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