跳到主要内容

Keyboard

搜索

结构体Keyboard 

Source
pub struct Keyboard { /* 私有字段 */ }

实现§

Trait 实现§

Source§

impl KeyboardState for Keyboard

Source§

fn add(&mut self, event_type: &EventType) -> Option<String>

如同该事件已发生一样地改变键盘状态。我们在此处并未真正调用操作系统,这在测试如果按下该键会发生什么时可能很有用。
Source§

fn reset(&mut self)

将键盘状态重置为未触碰过的状态(没有 Shift、Caps Lock 等)

自动 Trait 实现§

通用实现§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 阅读更多
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

对拥有的值进行不可变借用。阅读更多
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

对拥有的值进行可变借用。阅读更多
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

原样返回参数。

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

调用 U::from(self)

That is, this conversion is whatever the implementation of From<T> for U 的实现自行决定。

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

转换失败时返回的类型。
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

转换失败时返回的类型。
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行转换。