Base class for objects that can handle keyboard input events. More...
#include <Inputable.h>
Classes | |
struct | KeyEventPair |
Structure to hold key event pairs. More... | |
struct | MouseKeyEventPair |
Structure to hold mouse key event pairs. More... | |
struct | MouseRegistrationData |
Structure to hold registration data for mouse keys. More... | |
struct | RegistrationData |
Structure to hold registration data for keys. More... | |
Protected Member Functions | |
Inputable (const Inputable &)=delete | |
Inputable & | operator= (const Inputable &)=delete |
void | SubmitKeyRegistration (AZUL_KEY k, EventType e) |
Submits the key registration for the GameObject. | |
void | SubmitKeyDeregistration (AZUL_KEY k, EventType e) |
Submits the key deregistration for the GameObject. | |
void | SubmitMouseKeyRegistration (AZUL_MOUSE m, EventType e) |
Submits the mouse key registration for the GameObject. | |
void | SubmitMouseKeyDeregistration (AZUL_MOUSE m, EventType e) |
Submits the mouse key deregistration for the GameObject. | |
Private Types | |
using | KeyMap = std::map<KeyEventPair, RegistrationData*> |
Type alias for the key map. | |
using | MouseKeyMap = std::map<MouseKeyEventPair, MouseRegistrationData*> |
Type alias for the mouse key map. | |
using | KeyMapIt = KeyMap::iterator |
Type alias for the key map iterator. | |
using | MouseKeyMapIt = MouseKeyMap::iterator |
Type alias for the mouse key map iterator. | |
Private Member Functions | |
virtual void | KeyInactive (AZUL_KEY k) |
Virtual method to be implemented by derived classes for key inactive functionality. | |
virtual void | KeyPress (AZUL_KEY k) |
Virtual method to be implemented by derived classes for key press functionality. | |
virtual void | KeyHeld (AZUL_KEY k) |
Virtual method to be implemented by derived classes for key held functionality. | |
virtual void | KeyRelease (AZUL_KEY k) |
Virtual method to be implemented by derived classes for key release functionality. | |
virtual void | MouseInactive (AZUL_MOUSE m) |
Virtual method to be implemented by derived classes for mouse inactive functionality. | |
virtual void | MousePress (AZUL_MOUSE m) |
Virtual method to be implemented by derived classes for mouse press functionality. | |
virtual void | MouseHeld (AZUL_MOUSE m) |
Virtual method to be implemented by derived classes for mouse held functionality. | |
virtual void | MouseRelease (AZUL_MOUSE m) |
Virtual method to be implemented by derived classes for mouse release functionality. | |
void | KeyRegistration (AZUL_KEY k, EventType e) |
Registers the key for the GameObject. | |
void | KeyDeregistration (AZUL_KEY k, EventType e) |
Deregisters the key for the GameObject. | |
void | MouseKeyRegistration (AZUL_MOUSE m, EventType e) |
Registers the mouse key for the GameObject. | |
void | MouseKeyDeregistration (AZUL_MOUSE m, EventType e) |
Deregisters the mouse key for the GameObject. | |
Private Attributes | |
KeyMap | keyMap |
The key map of the GameObject. | |
MouseKeyMap | mouseKeyMap |
The mouse key map of the GameObject. | |
Friends | |
class | InputableAttorney |
Base class for objects that can handle keyboard input events.
The Inputable
class provides a base implementation for objects that need to handle keyboard input events. It manages registration and deregistration with the KeyboardEventManager
and provides virtual methods for handling different types of key events that can be overridden by derived classes.
|
private |
Deregisters the key for the GameObject.
k | The key to deregister. |
e | The event type to deregister. |
|
inlineprivatevirtual |
Virtual method to be implemented by derived classes for key held functionality.
k | The key that is held. |
Reimplemented in FreeCamera, and Textbox.
|
inlineprivatevirtual |
Virtual method to be implemented by derived classes for key inactive functionality.
k | The key that is inactive. |
|
inlineprivatevirtual |
Virtual method to be implemented by derived classes for key press functionality.
k | The key that is pressed. |
Reimplemented in FreeCamera, and Textbox.
|
private |
Registers the key for the GameObject.
k | The key to register. |
e | The event type to register. |
|
inlineprivatevirtual |
Virtual method to be implemented by derived classes for key release functionality.
k | The key that is released. |
Reimplemented in Textbox.
|
inlineprivatevirtual |
Virtual method to be implemented by derived classes for mouse held functionality.
m | The mouse key that is held. |
Reimplemented in Canvas.
|
inlineprivatevirtual |
Virtual method to be implemented by derived classes for mouse inactive functionality.
m | The mouse key that is inactive. |
|
private |
Deregisters the mouse key for the GameObject.
m | The mouse key to deregister. |
e | The event type to deregister. |
|
private |
Registers the mouse key for the GameObject.
m | The mouse key to register. |
e | The event type to register. |
|
inlineprivatevirtual |
Virtual method to be implemented by derived classes for mouse press functionality.
m | The mouse key that is pressed. |
Reimplemented in Canvas.
|
inlineprivatevirtual |
Virtual method to be implemented by derived classes for mouse release functionality.
m | The mouse key that is released. |
Reimplemented in Canvas.
|
protected |
Submits the key deregistration for the GameObject.
k | The key to deregister. |
e | The event type to deregister. |
|
protected |
Submits the key registration for the GameObject.
k | The key to register. |
e | The event type to register. |
|
protected |
Submits the mouse key deregistration for the GameObject.
m | The mouse key to deregister. |
e | The event type to deregister. |
|
protected |
Submits the mouse key registration for the GameObject.
m | The mouse key to register. |
e | The event type to register. |