pub enum KeyCode {
Show 16 variants
Tab,
BackTab,
Up,
Down,
Left,
Right,
Enter,
Space,
Escape,
Backspace,
Delete,
Home,
End,
PageUp,
PageDown,
Char(char),
}Expand description
物理按键与旋转编码器导航键值(面向无触摸屏 MCU 与桌面键盘)。
Variants§
Tab
切换焦点至下一个可聚焦元素(Tab 或旋钮顺时针)。
BackTab
切换焦点至上一个可聚焦元素(Shift+Tab 或旋钮逆时针)。
Up
方向键:上。
Down
方向键:下。
Left
方向键:左。
Right
方向键:右。
Enter
确认/触发当前焦点元素(Enter 或旋钮按下)。
Space
空格触发。
Escape
返回/取消。
Backspace
退格键(删除光标前字符)。
Delete
删除键(删除光标后字符)。
Home
移至行首。
End
移至行尾。
PageUp
向上翻页(PageUp)。
PageDown
向下翻页(PageDown)。
Char(char)
字符输入。
Trait Implementations§
impl Copy for KeyCode
impl Eq for KeyCode
impl StructuralPartialEq for KeyCode
Auto Trait Implementations§
impl Forget for KeyCode
impl Freeze for KeyCode
impl Move for KeyCode
impl RefUnwindSafe for KeyCode
impl Send for KeyCode
impl Sync for KeyCode
impl Unpin for KeyCode
impl UnsafeUnpin for KeyCode
impl UnwindSafe for KeyCode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。