#[repr(C)]pub struct SDL_KeyboardEvent {
pub type_: SDL_EventType,
pub reserved: Uint32,
pub timestamp: Uint64,
pub windowID: SDL_WindowID,
pub which: SDL_KeyboardID,
pub scancode: SDL_Scancode,
pub key: SDL_Keycode,
pub mod_: SDL_Keymod,
pub raw: Uint16,
pub down: bool,
pub repeat: bool,
}Expand description
Keyboard button event structure (event.key.*)
The key is the base SDL_Keycode generated by pressing the scancode
using the current keyboard layout, applying any options specified in
SDL_HINT_KEYCODE_OPTIONS. You can get the SDL_Keycode corresponding to the
event scancode and modifiers directly from the keyboard layout, bypassing
SDL_HINT_KEYCODE_OPTIONS, by calling SDL_GetKeyFromScancode().
Available Since: This struct is available since SDL 3.2.0.
See Also: SDL_GetKeyFromScancode See Also: SDL_HINT_KEYCODE_OPTIONS
Fields§
§type_: SDL_EventType< SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP
reserved: Uint32§timestamp: Uint64< In nanoseconds, populated using SDL_GetTicksNS()
windowID: SDL_WindowID< The window with keyboard focus, if any
which: SDL_KeyboardID< The keyboard instance id, or 0 if unknown or virtual
scancode: SDL_Scancode< SDL physical key code
key: SDL_Keycode< SDL virtual key code
mod_: SDL_Keymod< current key modifiers
raw: Uint16< The platform dependent scancode for this event
down: bool< true if the key is pressed
repeat: bool< true if this is a key repeat
Trait Implementations§
Source§impl Clone for SDL_KeyboardEvent
impl Clone for SDL_KeyboardEvent
Source§fn clone(&self) -> SDL_KeyboardEvent
fn clone(&self) -> SDL_KeyboardEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more