SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::events::KeyEvent Class Reference

A base class for all key events. More...

#include <KeyEvents.h>

Inheritance diagram for spark::events::KeyEvent:
spark::events::Event spark::rtti::HasRtti spark::events::KeyPressedEvent spark::events::KeyReleasedEvent spark::events::KeyTypedEvent

Public Member Functions

base::KeyCode keyCode () const noexcept
 Gets the key code of the key that triggered this event.
 
- Public Member Functions inherited from spark::events::Event
 Event (const Event &other)=default
 
 Event (Event &&other) noexcept=default
 
Eventoperator= (const Event &other)=default
 
Eventoperator= (Event &&other) noexcept=default
 
virtual EventType eventType () const =0
 Gets the type of the event.
 
virtual int eventCategoryFlags () const =0
 Gets the category flags of the event.
 
bool isInCategory (const EventCategory &category) const
 Checks if the event is in the specified category.
 
- Public Member Functions inherited from spark::rtti::HasRtti
 HasRtti (const HasRtti &other)=default
 
 HasRtti (HasRtti &&other) noexcept=default
 
HasRttioperator= (const HasRtti &other)=default
 
HasRttioperator= (HasRtti &&other) noexcept=default
 
virtual RttiBaserttiInstance () const =0
 

Protected Member Functions

 KeyEvent (base::KeyCode key) noexcept
 

Protected Attributes

base::KeyCode key
 

Additional Inherited Members

- Public Attributes inherited from spark::events::Event
bool handled = false
 

Detailed Description

A base class for all key events.

Member Function Documentation

◆ keyCode()

base::KeyCode spark::events::KeyEvent::keyCode ( ) const
nodiscardnoexcept

Gets the key code of the key that triggered this event.

Returns
The key code of the key that triggered this event.