pub struct RawKeyInputArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub device_id: InputDeviceId,
pub key_code: KeyCode,
pub key_location: KeyLocation,
pub state: KeyState,
pub key: Key,
pub key_modified: Key,
pub text: Txt,
pub propagation: EventPropagationHandle,
}Expand description
Arguments for the RAW_KEY_INPUT_EVENT.
Fields§
§timestamp: DInstantInstant the event happened.
window_id: WindowIdWindow that received the event.
device_id: InputDeviceIdKeyboard device that generated the event.
key_code: KeyCodePhysical key.
key_location: KeyLocationThe location of the key on the keyboard.
state: KeyStateIf the key was pressed or released.
key: KeySemantic key.
Pressing Shift+A key will produce Key::Char('a') in QWERTY keyboards, the modifiers are not applied.
key_modified: KeySemantic key modified by the current active modifiers.
Pressing Shift+A key will produce Key::Char('A') in QWERTY keyboards, the modifiers are applied.
text: TxtText typed.
This is only set for KeyState::Pressed of a key that generates text.
This is usually the key_modified char, but is also '\r' for Key::Enter. On Windows when a dead key was
pressed earlier but cannot be combined with the character from this key press, the produced text
will consist of two characters: the dead-key-character followed by the character resulting from this key press.
propagation: EventPropagationHandlePropagation handle associated with this event instance.
Cloned arguments share the same handle, some arguments may also share the handle of another event if they share the same cause.
Implementations§
Source§impl RawKeyInputArgs
impl RawKeyInputArgs
Sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation: EventPropagationHandle,
window_id: impl Into<WindowId>,
device_id: impl Into<InputDeviceId>,
key_code: impl Into<KeyCode>,
key_location: impl Into<KeyLocation>,
state: impl Into<KeyState>,
key: impl Into<Key>,
key_modified: impl Into<Key>,
text: impl Into<Txt>,
) -> Self
pub fn new( timestamp: impl Into<DInstant>, propagation: EventPropagationHandle, window_id: impl Into<WindowId>, device_id: impl Into<InputDeviceId>, key_code: impl Into<KeyCode>, key_location: impl Into<KeyLocation>, state: impl Into<KeyState>, key: impl Into<Key>, key_modified: impl Into<Key>, text: impl Into<Txt>, ) -> Self
New args from values that convert into the argument types.
Sourcepub fn now(
window_id: impl Into<WindowId>,
device_id: impl Into<InputDeviceId>,
key_code: impl Into<KeyCode>,
key_location: impl Into<KeyLocation>,
state: impl Into<KeyState>,
key: impl Into<Key>,
key_modified: impl Into<Key>,
text: impl Into<Txt>,
) -> Self
pub fn now( window_id: impl Into<WindowId>, device_id: impl Into<InputDeviceId>, key_code: impl Into<KeyCode>, key_location: impl Into<KeyLocation>, state: impl Into<KeyState>, key: impl Into<Key>, key_modified: impl Into<Key>, text: impl Into<Txt>, ) -> Self
Arguments for event that happened now (INSTANT.now).
Trait Implementations§
Source§impl AnyEventArgs for RawKeyInputArgs
impl AnyEventArgs for RawKeyInputArgs
Source§fn is_in_target(&self, id: WidgetId) -> bool
fn is_in_target(&self, id: WidgetId) -> bool
Broadcast to all widgets.
Source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
Source§fn clone_boxed(&self) -> Box<dyn AnyEventArgs>
fn clone_boxed(&self) -> Box<dyn AnyEventArgs>
Source§impl Clone for RawKeyInputArgs
impl Clone for RawKeyInputArgs
Source§fn clone(&self) -> RawKeyInputArgs
fn clone(&self) -> RawKeyInputArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RawKeyInputArgs
impl Debug for RawKeyInputArgs
Source§impl PartialEq for RawKeyInputArgs
impl PartialEq for RawKeyInputArgs
impl EventArgs for RawKeyInputArgs
impl StructuralPartialEq for RawKeyInputArgs
Auto Trait Implementations§
impl Freeze for RawKeyInputArgs
impl RefUnwindSafe for RawKeyInputArgs
impl Send for RawKeyInputArgs
impl Sync for RawKeyInputArgs
impl Unpin for RawKeyInputArgs
impl UnwindSafe for RawKeyInputArgs
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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