Trait tfc::traits::KeyboardContext
source · pub trait KeyboardContext: FallibleContext {
// Required methods
fn key_down(
&mut self,
key: Key
) -> Result<(), GenericError<Self::PlatformError>>;
fn key_up(
&mut self,
key: Key
) -> Result<(), GenericError<Self::PlatformError>>;
// Provided method
fn key_click(
&mut self,
key: Key
) -> Result<(), GenericError<Self::PlatformError>> { ... }
}
Expand description
A context that supports keyboard events.
Platform Differences
Key::Fn
and Key::NumpadClear
are supported on macOS only. In the future,
they may be named to reflect this or removed entirely.
Required Methods§
sourcefn key_down(
&mut self,
key: Key
) -> Result<(), GenericError<Self::PlatformError>>
fn key_down( &mut self, key: Key ) -> Result<(), GenericError<Self::PlatformError>>
Press down a key.
sourcefn key_up(&mut self, key: Key) -> Result<(), GenericError<Self::PlatformError>>
fn key_up(&mut self, key: Key) -> Result<(), GenericError<Self::PlatformError>>
Release a key.