Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::KeyPressedEvent Class Reference

Event triggered when a key is pressed. More...

#include <KeyEvent.h>

Inheritance diagram for Raven::KeyPressedEvent:
Raven::KeyEvent Raven::Event

Public Member Functions

 KeyPressedEvent (int keycode, bool isRepeat)
 Constructs a KeyPressedEvent.
bool IsRepeat () const
 Indicates if the key press is a repeated event.
std::string ToString () const override
 Returns a string representation of the event.
Public Member Functions inherited from Raven::KeyEvent
int GetKeyCode () const
 Returns the key code associated with this event.
Public Member Functions inherited from Raven::Event
virtual ~Event ()=default
virtual EventType GetEventType () const =0
 Returns the runtime event type.
virtual const char * GetName () const =0
 Returns the name of the event.
virtual EventCategory GetCategoryFlags () const =0
 Returns the category flags of the event.
bool IsInCategory (EventCategory category) const
 Checks if the event belongs to the specified category.

Additional Inherited Members

Public Attributes inherited from Raven::Event
bool Handled = false
 Indicates whether the event has been handled.
Protected Member Functions inherited from Raven::KeyEvent
 KeyEvent (int keycode)
 Protected constructor for KeyEvent.
Protected Attributes inherited from Raven::KeyEvent
int m_KeyCode

Detailed Description

Event triggered when a key is pressed.

Includes an additional flag to indicate if the event is a repeat (key held down).

Constructor & Destructor Documentation

◆ KeyPressedEvent()

Raven::KeyPressedEvent::KeyPressedEvent ( int keycode,
bool isRepeat )
inline

Constructs a KeyPressedEvent.

Parameters
keycodeThe key code of the pressed key.
isRepeatTrue if the key press is a repeat (from key hold).

Member Function Documentation

◆ IsRepeat()

bool Raven::KeyPressedEvent::IsRepeat ( ) const
inlinenodiscard

Indicates if the key press is a repeated event.

Returns
True if the event is a repeat.

◆ ToString()

std::string Raven::KeyPressedEvent::ToString ( ) const
inlinenodiscardoverridevirtual

Returns a string representation of the event.

Returns
A formatted string with key code and repeat flag.

Reimplemented from Raven::Event.


The documentation for this class was generated from the following file: