Dragonfly 4.19
A text-based game engine
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
df::InputManager Class Reference
Inheritance diagram for df::InputManager:
Inheritance graph

Public Member Functions

bool isValid (std::string event_type) const override
 
int startUp () override
 
void shutDown () override
 
void getInput () const
 
- Public Member Functions inherited from df::Manager
std::string getType () const
 
virtual int startUp ()
 
virtual void shutDown ()
 
bool isStarted () const
 
int onEvent (const Event *p_event) const
 
int registerInterest (Object *p_o, std::string event_type)
 
int unregisterInterest (Object *p_o, std::string event_type)
 

Static Public Member Functions

static InputManagergetInstance ()
 

Private Member Functions

 InputManager ()
 
 InputManager (InputManager const &)
 
void operator= (InputManager const &)
 

Additional Inherited Members

- Protected Member Functions inherited from df::Manager
void setType (std::string new_type)
 

Constructor & Destructor Documentation

◆ InputManager() [1/2]

df::InputManager::InputManager ( )
private

Private since a singleton.

◆ InputManager() [2/2]

df::InputManager::InputManager ( InputManager const &  )
private

Don't allow copy.

Member Function Documentation

◆ getInput()

void df::InputManager::getInput ( ) const

Get input from the keyboard and mouse.

Pass event along to all interested Objects.

◆ getInstance()

static InputManager & df::InputManager::getInstance ( )
static

Get the one and only instance of the InputManager.

◆ isValid()

bool df::InputManager::isValid ( std::string  event_type) const
overridevirtual

Input manager only accepts keyboard and mouse events.

Return false if not one of them.

Reimplemented from df::Manager.

◆ operator=()

void df::InputManager::operator= ( InputManager const &  )
private

Don't allow assignment.

◆ shutDown()

void df::InputManager::shutDown ( )
overridevirtual

Revert back to normal window mode.

Reimplemented from df::Manager.

◆ startUp()

int df::InputManager::startUp ( )
overridevirtual

Get window ready to capture input.


Return 0 if ok, else return -1;

Reimplemented from df::Manager.