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,
/* private fields */
}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.
Implementations§
Source§impl RawKeyInputArgs
impl RawKeyInputArgs
Sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation_handle: 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_handle: 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 delivery_list(&self, list: &mut UpdateDeliveryList)
fn delivery_list(&self, list: &mut UpdateDeliveryList)
Broadcast to all widgets.
Source§fn clone_any(&self) -> Box<dyn AnyEventArgs>
fn clone_any(&self) -> Box<dyn AnyEventArgs>
Source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
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
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> 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