Trait components::engine::d2::subsystem::KeyboardSystem
source · [−]pub trait KeyboardSystem {
fn is_supported(&self) -> bool;
fn down_signal(&self) -> &Signal1<KeyboardEvent>;
fn up_signal(&self) -> &Signal1<KeyboardEvent>;
fn back_button(&self) -> &Signal0;
fn is_down(&self, key: Key) -> bool;
}
Expand description
Functions related to the environment’s physical keyboard.
Required Methods
fn is_supported(&self) -> bool
fn is_supported(&self) -> bool
Whether the environment has a physical keyboard. Phones and tablets will generally return false here.
fn down_signal(&self) -> &Signal1<KeyboardEvent>
fn down_signal(&self) -> &Signal1<KeyboardEvent>
Emitted when a key is pressed down.
fn up_signal(&self) -> &Signal1<KeyboardEvent>
fn up_signal(&self) -> &Signal1<KeyboardEvent>
Emitted when a key is released.
Emitted when a hardware back button is pressed. If no listeners are connected to this signal when the back button is pressed, the platform’s default action will be taken (which is usually to close the app). Only supported on Android.