Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
Muto::KeyPressedEvent Class Reference

Event for registering key press. More...

#include <KeyEvent.h>

Inheritance diagram for Muto::KeyPressedEvent:
Muto::KeyEvent Muto::Event

Public Member Functions

int GetRepeatCount () const
 Get the repeat count of the key press event.
 
 KeyPressedEvent (int keycode, int repeatCount)
 Construct a KeyPressedEvent with the specified key code and repeat count.
 
std::string ToString () const override
 Convert the event to a string representation.
 
- Public Member Functions inherited from Muto::KeyEvent
int GetKeyCode () const
 Get the key code associated with the event.
 
- Public Member Functions inherited from Muto::Event
virtual int GetCategoryFlags () const =0
 Get the category flags of the event.
 
virtual EventType GetEventType () const =0
 Get the type of the event.
 
virtual const char * GetName () const =0
 Get the name of the event.
 
bool IsInCategory (EventCategory category)
 Check if the event is in a specific category.
 
virtual ~Event ()=default
 

Private Attributes

int m_RepeatCount
 

Additional Inherited Members

- Public Attributes inherited from Muto::Event
bool Handled = false
 Indicates whether the event has been handled.
 
- Protected Member Functions inherited from Muto::KeyEvent
 KeyEvent (int keycode)
 Construct a KeyEvent with the specified key code.
 
- Protected Attributes inherited from Muto::KeyEvent
int m_KeyCode
 

Detailed Description

Event for registering key press.

Constructor & Destructor Documentation

◆ KeyPressedEvent()

Muto::KeyPressedEvent::KeyPressedEvent ( int  keycode,
int  repeatCount 
)
inline

Construct a KeyPressedEvent with the specified key code and repeat count.

Parameters
keycodeThe key code associated with the event.
repeatCountThe number of times the key press is repeated.
KeyEvent(int keycode)
Construct a KeyEvent with the specified key code.
Definition KeyEvent.h:29
int m_RepeatCount
Definition KeyEvent.h:60
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51

References Muto::KeyEvent::KeyEvent(), and m_RepeatCount.

Member Function Documentation

◆ GetRepeatCount()

int Muto::KeyPressedEvent::GetRepeatCount ( ) const
inline

Get the repeat count of the key press event.

48{ return m_RepeatCount; }

References m_RepeatCount.

Referenced by Muto::EditorLayer::OnKeyPressed().

◆ ToString()

std::string Muto::KeyPressedEvent::ToString ( ) const
inlineoverridevirtual

Convert the event to a string representation.

Reimplemented from Muto::Event.

52 {
53 std::stringstream ss;
54 ss << "KeyPressedEvent: " << m_KeyCode << " (" << m_RepeatCount << " repeats)";
55 return ss.str();
56 }
int m_KeyCode
Definition KeyEvent.h:31

References Muto::KeyEvent::m_KeyCode, and m_RepeatCount.

Member Data Documentation

◆ m_RepeatCount

int Muto::KeyPressedEvent::m_RepeatCount
private

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