pub enum ShellEvent {
CursorMoved {
position: Point,
},
MouseInput {
position: Point,
button: MouseButton,
pressed: bool,
modifiers: KeyModifiers,
},
CursorLeft,
Wheel {
position: Point,
delta: Point,
modifiers: KeyModifiers,
},
ModifiersChanged(KeyModifiers),
Keyboard {
key: KeyCode,
pressed: bool,
repeat: bool,
modifiers: KeyModifiers,
},
Focused(bool),
Ime(ImeEvent),
FileHovered(PathBuf),
FileHoverCancelled,
FileDropped(PathBuf),
ThemeChanged(SystemTheme),
}Expand description
平台无关输入事件 —— 桌面 shell 把原生事件翻译成此类型后再交给应用。
坐标语义:全部为 root layer 逻辑坐标(已按 DPR 换算)。
Variants§
CursorMoved
MouseInput
CursorLeft
光标离开窗口客户区(没有按键捕获时)
Wheel
滚轮/触控板:delta 已归一化为逻辑像素(约 16px/行)。
ModifiersChanged(KeyModifiers)
Keyboard
Focused(bool)
Ime(ImeEvent)
FileHovered(PathBuf)
文件被拖入窗口(每个文件一次)。
FileHoverCancelled
拖入的文件离开窗口。
FileDropped(PathBuf)
文件在窗口内释放。
ThemeChanged(SystemTheme)
系统明暗主题变化。
Trait Implementations§
Source§impl Clone for ShellEvent
impl Clone for ShellEvent
Source§fn clone(&self) -> ShellEvent
fn clone(&self) -> ShellEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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 Forget for ShellEvent
impl Freeze for ShellEvent
impl Move for ShellEvent
impl RefUnwindSafe for ShellEvent
impl Send for ShellEventwhere
RawVecInner: Send,
impl Sync for ShellEventwhere
RawVecInner: Sync,
impl Unpin for ShellEvent
impl UnsafeUnpin for ShellEvent
impl UnwindSafe for ShellEventwhere
RawVecInner: UnwindSafe,
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