Struct components::engine::d2::platform::BasicKeyboard
source · [−]pub struct BasicKeyboard {
pub down: Signal1<KeyboardEvent>,
pub up: Signal1<KeyboardEvent>,
pub back_button: Signal0,
/* private fields */
}
Fields
down: Signal1<KeyboardEvent>
up: Signal1<KeyboardEvent>
Implementations
sourceimpl BasicKeyboard
impl BasicKeyboard
pub fn new() -> BasicKeyboard
sourcepub fn submit_down(&mut self, key_code: i32) -> bool
pub fn submit_down(&mut self, key_code: i32) -> bool
Called by the platform to handle a down event. @return Whether default action should be prevented.
Trait Implementations
sourceimpl KeyboardSystem for BasicKeyboard
impl KeyboardSystem for BasicKeyboard
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. Read more
sourcefn down_signal(&self) -> &Signal1<KeyboardEvent>
fn down_signal(&self) -> &Signal1<KeyboardEvent>
Emitted when a key is pressed down.
sourcefn up_signal(&self) -> &Signal1<KeyboardEvent>
fn up_signal(&self) -> &Signal1<KeyboardEvent>
Emitted when a key is released.
sourcefn is_down(&self, key: Key) -> bool
fn is_down(&self, key: Key) -> bool
@returns True if the given key is currently being held down.
sourcefn is_supported(&self) -> bool
fn is_supported(&self) -> bool
Whether the environment has a physical keyboard. Phones and tablets will generally return false here. Read more
Auto Trait Implementations
impl !RefUnwindSafe for BasicKeyboard
impl !Send for BasicKeyboard
impl !Sync for BasicKeyboard
impl Unpin for BasicKeyboard
impl !UnwindSafe for BasicKeyboard
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.