pub struct KeyEventCreationInfo<'a, 'b> {
pub ty: KeyEventType,
pub modifiers: KeyEventModifiers,
pub virtual_key_code: VirtualKeyCode,
pub native_key_code: i32,
pub text: &'a str,
pub unmodified_text: &'b str,
pub is_keypad: bool,
pub is_auto_repeat: bool,
pub is_system_key: bool,
}Expand description
Wrapper around all arguments needed to create a KeyEvent.
Fields§
§ty: KeyEventTypeThe type of the event.
modifiers: KeyEventModifiersThe modifiers that were pressed with the key.
virtual_key_code: VirtualKeyCodeThe virtual key-code associated with this keyboard event. This is either directly from the event (ie, WPARAM on Windows) or via a mapping function.
native_key_code: i32The actual key-code generated by the platform.
The DOM spec primarily uses Windows-equivalent codes
(hence virtual_key_code above) but it helps to also specify the
platform-specific key-code as well.
text: &'a strThe actual text generated by this keyboard event. This is usually only a single character.
unmodified_text: &'b strThe text generated by this keyboard event before all modifiers except shift are applied. This is used internally for working out shortcut keys. This is usually only a single character.
is_keypad: boolWhether or not this is a keypad event.
is_auto_repeat: boolWhether or not this was generated as the result of an auto-repeat (eg, holding down a key)
is_system_key: boolWhether or not the pressed key is a “system key”. This is a Windows-only concept and should be “false” for all non-Windows platforms. For more information, see the following link: http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx