Class KeyPressedEvent¶
Defined in File input_events.h
Inheritance Relationships¶
Base Type¶
public Event
Class Documentation¶
-
class KeyPressedEvent : public Event¶
Event fired when a key transitions to the Pressed state.
Triggered exactly once when a keyboard key or mouse button is initially pressed down (state transition from Released to Pressed). Contains the key identifier and active modifier flags, enabling keyboard shortcut detection (e.g., Ctrl+S).
After one frame, the key automatically transitions to Repeat state and subsequent events will be KeyRepeatEvent instead.
See also
KeyRepeatEvent - Fired while key is held down
See also
KeyReleasedEvent - Fired when key is released
Public Functions
-
inline KeyPressedEvent(const Key key, const KeyModifierFlag modifiers)¶
-
inline KeyModifierFlag get_modifiers() const¶
Public Members
- EVENT_CLASS_TYPE(KeyPressed) EVENT_CLASS_CATEGORY(Input) private KeyModifierFlag active_modifiers
-
inline KeyPressedEvent(const Key key, const KeyModifierFlag modifiers)¶