C++ SDK for MANUS Core 2.0
Loading...
Searching...
No Matches
ClientInput Class Reference

Handles keyboard input. Requires things to be set up with Ncurses and Termios. More...

Public Member Functions

void Update (void)
 Update the state of the keyboard. More...
 
bool GetKey (const int p_Key)
 Get the key's current state. Note that unlike IsPressed(), this also stores the result for use in the next key state check. More...
 
bool GetKeyDown (const int p_Key)
 Was this key pressed since the last check? Note that unlike WasJustPressed(), this checks if the key was pressed since the last time a GetKey* function was called. More...
 
bool GetKeyUp (const int p_Key)
 Was this key released since the last check? Note that unlike WasJustReleased(), this checks if the key was released since the last time a GetKey* function was called. More...
 

Private Types

typedef std::map< int, bool > InputMap_t
 

Private Member Functions

bool IsPressed (const int p_Key) const
 Get the key's current state. Note that unlike GetKey(), this does not store the result for use in the next key state check. More...
 
bool WasJustPressed (const int p_Key) const
 Was this key pressed since the last input update? Note that unlike GetKeyDown(), this function will return the same value until the next keyboard state update. More...
 
bool WasJustReleased (const int p_Key) const
 Was this key released since the last input update? Note that unlike GetKeyUp(), this function will return the same value until the next keyboard state update. More...
 
bool WasPressedLastUpdate (const int p_Key) const
 Was this key pressed the previous input update? More...
 

Private Attributes

InputMap_t m_CurrentlyPressed
 
InputMap_t m_PressedLastUpdate
 
InputMap_t m_PreviousKeyState
 

Detailed Description

Handles keyboard input. Requires things to be set up with Ncurses and Termios.

Definition at line 228 of file ClientPlatformSpecific.cpp.

Member Typedef Documentation

◆ InputMap_t

typedef std::map<int, bool> InputMap_t
private

Definition at line 370 of file ClientPlatformSpecific.cpp.

Member Function Documentation

◆ GetKey()

bool GetKey ( const int  p_Key)
inline

Get the key's current state. Note that unlike IsPressed(), this also stores the result for use in the next key state check.

Definition at line 281 of file ClientPlatformSpecific.cpp.

◆ GetKeyDown()

bool GetKeyDown ( const int  p_Key)
inline

Was this key pressed since the last check? Note that unlike WasJustPressed(), this checks if the key was pressed since the last time a GetKey* function was called.

Definition at line 292 of file ClientPlatformSpecific.cpp.

◆ GetKeyUp()

bool GetKeyUp ( const int  p_Key)
inline

Was this key released since the last check? Note that unlike WasJustReleased(), this checks if the key was released since the last time a GetKey* function was called.

Definition at line 311 of file ClientPlatformSpecific.cpp.

◆ IsPressed()

bool IsPressed ( const int  p_Key) const
inlineprivate

Get the key's current state. Note that unlike GetKey(), this does not store the result for use in the next key state check.

Definition at line 331 of file ClientPlatformSpecific.cpp.

◆ Update()

void Update ( void  )
inline

Update the state of the keyboard.

Definition at line 232 of file ClientPlatformSpecific.cpp.

◆ WasJustPressed()

bool WasJustPressed ( const int  p_Key) const
inlineprivate

Was this key pressed since the last input update? Note that unlike GetKeyDown(), this function will return the same value until the next keyboard state update.

Definition at line 345 of file ClientPlatformSpecific.cpp.

◆ WasJustReleased()

bool WasJustReleased ( const int  p_Key) const
inlineprivate

Was this key released since the last input update? Note that unlike GetKeyUp(), this function will return the same value until the next keyboard state update.

Definition at line 353 of file ClientPlatformSpecific.cpp.

◆ WasPressedLastUpdate()

bool WasPressedLastUpdate ( const int  p_Key) const
inlineprivate

Was this key pressed the previous input update?

Definition at line 359 of file ClientPlatformSpecific.cpp.

Member Data Documentation

◆ m_CurrentlyPressed

InputMap_t m_CurrentlyPressed
private

Definition at line 371 of file ClientPlatformSpecific.cpp.

◆ m_PressedLastUpdate

InputMap_t m_PressedLastUpdate
private

Definition at line 372 of file ClientPlatformSpecific.cpp.

◆ m_PreviousKeyState

InputMap_t m_PreviousKeyState
private

Definition at line 376 of file ClientPlatformSpecific.cpp.


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