Trait zng::keyboard::HeadlessAppKeyboardExt

source ·
pub trait HeadlessAppKeyboardExt {
    // Required methods
    fn on_keyboard_input(
        &mut self,
        window_id: WindowId,
        code: KeyCode,
        location: KeyLocation,
        key: Key,
        state: KeyState,
    );
    fn press_key(
        &mut self,
        window_id: WindowId,
        code: KeyCode,
        location: KeyLocation,
        key: Key,
    );
    fn press_modified_key(
        &mut self,
        window_id: WindowId,
        modifiers: ModifiersState,
        code: KeyCode,
        location: KeyLocation,
        key: Key,
    );
}
Expand description

Extension trait that adds keyboard simulation methods to HeadlessApp.

Required Methods§

source

fn on_keyboard_input( &mut self, window_id: WindowId, code: KeyCode, location: KeyLocation, key: Key, state: KeyState, )

Notifies keyboard input event.

Note that the app is not updated so the event is pending after this call.

source

fn press_key( &mut self, window_id: WindowId, code: KeyCode, location: KeyLocation, key: Key, )

Does a key-down, key-up and updates.

source

fn press_modified_key( &mut self, window_id: WindowId, modifiers: ModifiersState, code: KeyCode, location: KeyLocation, key: Key, )

Does a modifiers changed, key-down, key-up, reset modifiers and updates.

Implementors§