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

Base class for keyboard events. More...

#include <KeyEvent.h>

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

Public Member Functions

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 std::string ToString () const
 Convert the event to a string representation.
 
virtual ~Event ()=default
 

Protected Member Functions

 KeyEvent (int keycode)
 Construct a KeyEvent with the specified key code.
 

Protected Attributes

int m_KeyCode
 

Additional Inherited Members

- Public Attributes inherited from Muto::Event
bool Handled = false
 Indicates whether the event has been handled.
 

Detailed Description

Base class for keyboard events.

Constructor & Destructor Documentation

◆ KeyEvent()

Muto::KeyEvent::KeyEvent ( int  keycode)
inlineprotected

Construct a KeyEvent with the specified key code.

Parameters
keycodeThe key code associated with the event. Restricted specific construction to derived classes.
30 : m_KeyCode(keycode) {}
int m_KeyCode
Definition KeyEvent.h:31
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51

References m_KeyCode.

Referenced by Muto::KeyPressedEvent::KeyPressedEvent(), Muto::KeyReleasedEvent::KeyReleasedEvent(), and Muto::KeyTypedEvent::KeyTypedEvent().

Member Function Documentation

◆ GetKeyCode()

int Muto::KeyEvent::GetKeyCode ( ) const
inline

Get the key code associated with the event.

20{ return m_KeyCode; }

References m_KeyCode.

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

Member Data Documentation

◆ m_KeyCode


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