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§
sourcefn on_keyboard_input(
&mut self,
window_id: WindowId,
code: KeyCode,
location: KeyLocation,
key: Key,
state: KeyState,
)
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.
sourcefn press_key(
&mut self,
window_id: WindowId,
code: KeyCode,
location: KeyLocation,
key: Key,
)
fn press_key( &mut self, window_id: WindowId, code: KeyCode, location: KeyLocation, key: Key, )
Does a key-down, key-up and updates.
sourcefn press_modified_key(
&mut self,
window_id: WindowId,
modifiers: ModifiersState,
code: KeyCode,
location: KeyLocation,
key: Key,
)
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.