pub struct KEYBOARD;Expand description
Keyboard service.
§Provider
This service is provided by the KeyboardManager extension, it will panic if used in an app not extended.
Implementations§
Source§impl KEYBOARD
impl KEYBOARD
Sourcepub fn modifiers(&self) -> Var<ModifiersState>
pub fn modifiers(&self) -> Var<ModifiersState>
Returns a read-only variable that tracks the currently pressed modifier keys.
Sourcepub fn codes(&self) -> Var<Vec<KeyCode>>
pub fn codes(&self) -> Var<Vec<KeyCode>>
Returns a read-only variable that tracks the KeyCode of the keys currently pressed.
Sourcepub fn keys(&self) -> Var<Vec<Key>>
pub fn keys(&self) -> Var<Vec<Key>>
Returns a read-only variable that tracks the Key identifier of the keys currently pressed.
Sourcepub fn repeat_config(&self) -> Var<KeyRepeatConfig>
pub fn repeat_config(&self) -> Var<KeyRepeatConfig>
Returns a variable that defines key press repeat start delay and repeat speed on the app.
This delay is roughly the time the user must hold a key pressed to start repeating. When a second key press
happens without any other keyboard event and within twice this value it increments the repeat_count by the KeyboardManager.
The value is the same as sys_repeat_config, if set the variable disconnects from system config.
Sourcepub fn sys_repeat_config(&self) -> Var<KeyRepeatConfig>
pub fn sys_repeat_config(&self) -> Var<KeyRepeatConfig>
Returns a read-only variable that tracks the operating system key press repeat start delay and repeat speed.
The variable updates every time the system config changes and on view-process (re)init.
Sourcepub fn caret_animation_config(&self) -> Var<(Duration, Duration)>
pub fn caret_animation_config(&self) -> Var<(Duration, Duration)>
Returns a variable that defines the system config for the caret blink speed and timeout for the app.
The first value defines the blink speed interval, the caret is visible for the duration, then not visible for the duration. The second value defines the animation total duration, the caret stops animating and sticks to visible after this timeout is reached.
You can use the caret_animation method to generate a new animation.
The value is the same as sys_repeat_config, if set the variable disconnects from system config.
Sourcepub fn sys_caret_animation_config(&self) -> Var<(Duration, Duration)>
pub fn sys_caret_animation_config(&self) -> Var<(Duration, Duration)>
Returns a read-only variable that tracks the operating system caret blink speed and timeout.
The variable updates every time the system config changes and on view-process (re)init.
Sourcepub fn caret_animation(&self) -> Var<Factor>
pub fn caret_animation(&self) -> Var<Factor>
Returns a new read-only variable that animates the caret opacity.
A new animation must be started after each key press. The value is always 1 or 0, no easing is used by default,
it can be added using the Var::easing method.
Auto Trait Implementations§
impl Freeze for KEYBOARD
impl RefUnwindSafe for KEYBOARD
impl Send for KEYBOARD
impl Sync for KEYBOARD
impl Unpin for KEYBOARD
impl UnwindSafe for KEYBOARD
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more