A virtual derived class of GameObject that allows the GameObject to register and test input keys. More...

#include <Inputable.h>

Inheritance diagram for Inputable:

Detailed Description

A virtual derived class of GameObject that allows the GameObject to register and test input keys.

A class that inherits from Inputable gains access to the KeyPressed() and KeyReleased() functions. These allow the user to execute code every time a registered key is pressed or released.

Public Attributes

std::map< KeyEventPair, RegistrationData > RegMap
 

Protected Member Functions

virtual void KeyPressed (const ION_KEY &key_in)=0
 Function which is called every time a registered key is pressed. More...
 
virtual void KeyReleased (const ION_KEY &key_in)=0
 Function which is called every time a registered key is released. More...
 
void RegisterKey (const ION_KEY &key_in, const INPUT_EVENT &event_type)
 Function to register a specific key and it's event type (pressed or released) More...
 
void DeregisterKey (const ION_KEY &key_in, const INPUT_EVENT &event_type)
 Function to deregister a specific key and it's event type (pressed or released) More...
 
- Protected Member Functions inherited from GameObject
virtual void SceneEntry ()=0
 Function which is called upon a registered scene entry. More...
 
virtual void SceneExit ()=0
 Function which is called upon a registered scene exit. More...
 

Additional Inherited Members

- Public Member Functions inherited from GameObject
void SubmitEntry ()
 Public Function to register a call for the GameObject's SceneEntry() function. More...
 
void SubmitExit ()
 Public Function to register a call for the GameObject's SceneEntry() function. More...
 

Member Function Documentation

void Inputable::DeregisterKey ( const ION_KEY &  key_in,
const INPUT_EVENT &  event_type 
)
protected

Function to deregister a specific key and it's event type (pressed or released)

This function deregisters the specified key and it's event type from being checked every frame for this Inputable GameObject. Each key can be deregistered twice from the SingleKeyEventManager; once for pressed and once for released. These can be specified by the folowing INPUT_EVENT enum types:

  • Pressed: INPUT_EVENT::KEY_PRESSED
  • Released: INPUT_EVENT::KEY_RELEASED
Parameters
key_inThe ION_KEY to be deregistered.
event_typeThe INPUT_EVENT of the key to be deregistered.
virtual void Inputable::KeyPressed ( const ION_KEY &  key_in)
protectedpure virtual

Function which is called every time a registered key is pressed.

This is a pure virtual function to be overriden by the user. The KeyPressed() function will be called by the SingleKeyEventManager every time a registered key is pressed (See the RegisterKey() and DeregisterKey() functions).

Parameters
key_inThe ION_KEY type that is calling the event.
virtual void Inputable::KeyReleased ( const ION_KEY &  key_in)
protectedpure virtual

Function which is called every time a registered key is released.

This is a pure virtual function to be overriden by the user. The KeyReleased() function will be called by the SingleKeyEventManager every time a registered key is released (See the RegisterKey() and DeregisterKey() functions).

Parameters
key_inThe ION_KEY type that is calling the event.
void Inputable::RegisterKey ( const ION_KEY &  key_in,
const INPUT_EVENT &  event_type 
)
protected

Function to register a specific key and it's event type (pressed or released)

This function registers the specified key and it's event type to be checked every frame for this Inputable GameObject. Each key can be registered twice to the SingleKeyEventManager; once for pressed and once for released. These can be specified by the folowing INPUT_EVENT enum types:

  • Pressed: INPUT_EVENT::KEY_PRESSED
  • Released: INPUT_EVENT::KEY_RELEASED
Parameters
key_inThe ION_KEY to be registered.
event_typeThe INPUT_EVENT of the key to be registered.

Member Data Documentation

std::map<KeyEventPair, RegistrationData> Inputable::RegMap

Map of data used for registering to the scene