SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
Inputable Class Reference

Base class for objects that can handle keyboard input events. More...

#include <Inputable.h>

Inheritance diagram for Inputable:
Inheritance graph

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
 
Inputableoperator= (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
 

Detailed Description

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.

Member Function Documentation

◆ KeyDeregistration()

void Inputable::KeyDeregistration ( AZUL_KEY k,
EventType e )
private

Deregisters the key for the GameObject.

Parameters
kThe key to deregister.
eThe event type to deregister.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ KeyHeld()

virtual void Inputable::KeyHeld ( AZUL_KEY k)
inlineprivatevirtual

Virtual method to be implemented by derived classes for key held functionality.

Parameters
kThe key that is held.

Reimplemented in FreeCamera, and Textbox.

Here is the caller graph for this function:

◆ KeyInactive()

virtual void Inputable::KeyInactive ( AZUL_KEY k)
inlineprivatevirtual

Virtual method to be implemented by derived classes for key inactive functionality.

Parameters
kThe key that is inactive.
Here is the caller graph for this function:

◆ KeyPress()

virtual void Inputable::KeyPress ( AZUL_KEY k)
inlineprivatevirtual

Virtual method to be implemented by derived classes for key press functionality.

Parameters
kThe key that is pressed.

Reimplemented in FreeCamera, and Textbox.

Here is the caller graph for this function:

◆ KeyRegistration()

void Inputable::KeyRegistration ( AZUL_KEY k,
EventType e )
private

Registers the key for the GameObject.

Parameters
kThe key to register.
eThe event type to register.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ KeyRelease()

virtual void Inputable::KeyRelease ( AZUL_KEY k)
inlineprivatevirtual

Virtual method to be implemented by derived classes for key release functionality.

Parameters
kThe key that is released.

Reimplemented in Textbox.

Here is the caller graph for this function:

◆ MouseHeld()

virtual void Inputable::MouseHeld ( AZUL_MOUSE m)
inlineprivatevirtual

Virtual method to be implemented by derived classes for mouse held functionality.

Parameters
mThe mouse key that is held.

Reimplemented in Canvas.

Here is the caller graph for this function:

◆ MouseInactive()

virtual void Inputable::MouseInactive ( AZUL_MOUSE m)
inlineprivatevirtual

Virtual method to be implemented by derived classes for mouse inactive functionality.

Parameters
mThe mouse key that is inactive.
Here is the caller graph for this function:

◆ MouseKeyDeregistration()

void Inputable::MouseKeyDeregistration ( AZUL_MOUSE m,
EventType e )
private

Deregisters the mouse key for the GameObject.

Parameters
mThe mouse key to deregister.
eThe event type to deregister.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MouseKeyRegistration()

void Inputable::MouseKeyRegistration ( AZUL_MOUSE m,
EventType e )
private

Registers the mouse key for the GameObject.

Parameters
mThe mouse key to register.
eThe event type to register.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MousePress()

virtual void Inputable::MousePress ( AZUL_MOUSE m)
inlineprivatevirtual

Virtual method to be implemented by derived classes for mouse press functionality.

Parameters
mThe mouse key that is pressed.

Reimplemented in Canvas.

Here is the caller graph for this function:

◆ MouseRelease()

virtual void Inputable::MouseRelease ( AZUL_MOUSE m)
inlineprivatevirtual

Virtual method to be implemented by derived classes for mouse release functionality.

Parameters
mThe mouse key that is released.

Reimplemented in Canvas.

Here is the caller graph for this function:

◆ SubmitKeyDeregistration()

void Inputable::SubmitKeyDeregistration ( AZUL_KEY k,
EventType e )
protected

Submits the key deregistration for the GameObject.

Parameters
kThe key to deregister.
eThe event type to deregister.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SubmitKeyRegistration()

void Inputable::SubmitKeyRegistration ( AZUL_KEY k,
EventType e )
protected

Submits the key registration for the GameObject.

Parameters
kThe key to register.
eThe event type to register.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SubmitMouseKeyDeregistration()

void Inputable::SubmitMouseKeyDeregistration ( AZUL_MOUSE m,
EventType e )
protected

Submits the mouse key deregistration for the GameObject.

Parameters
mThe mouse key to deregister.
eThe event type to deregister.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SubmitMouseKeyRegistration()

void Inputable::SubmitMouseKeyRegistration ( AZUL_MOUSE m,
EventType e )
protected

Submits the mouse key registration for the GameObject.

Parameters
mThe mouse key to register.
eThe event type to register.
Here is the call graph for this function:
Here is the caller graph for this function:

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