Trait tfc::traits::KeyboardContext[][src]

pub trait KeyboardContext: FallibleContext {
    fn key_down(
        &mut self,
        key: Key
    ) -> Result<(), GenericError<Self::PlatformError>>;
fn key_up(
        &mut self,
        key: Key
    ) -> Result<(), GenericError<Self::PlatformError>>; fn key_click(
        &mut self,
        key: Key
    ) -> Result<(), GenericError<Self::PlatformError>> { ... } }

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

fn key_down(
    &mut self,
    key: Key
) -> Result<(), GenericError<Self::PlatformError>>
[src]

Press down a key.

fn key_up(&mut self, key: Key) -> Result<(), GenericError<Self::PlatformError>>[src]

Release a key.

Loading content...

Provided methods

fn key_click(
    &mut self,
    key: Key
) -> Result<(), GenericError<Self::PlatformError>>
[src]

Press and release a key.

This is equivalent to calling key_down followed by key_up. Although, some platforms may optimize this.

Loading content...

Implementors

impl KeyboardContext for Context[src]

Loading content...