pub struct RawKeyInputArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub device_id: DeviceId,
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: DInstant
Instant the event happened.
window_id: WindowId
Window that received the event.
device_id: DeviceId
Keyboard device that generated the event.
key_code: KeyCode
Physical key.
key_location: KeyLocation
The location of the key on the keyboard.
state: KeyState
If the key was pressed or released.
key: Key
Semantic key.
Pressing Shift+A
key will produce Key::Char('a')
in QWERTY keyboards, the modifiers are not applied.
key_modified: Key
Semantic key modified by the current active modifiers.
Pressing Shift+A
key will produce Key::Char('A')
in QWERTY keyboards, the modifiers are applied.
text: Txt
Text 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<DeviceId>,
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<DeviceId>, 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<DeviceId>,
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<DeviceId>, 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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