DDNet documentation
Loading...
Searching...
No Matches
CBinds Class Reference

#include <binds.h>

Inheritance diagram for CBinds:
[legend]
Collaboration diagram for CBinds:
[legend]

Classes

class  CBindsSpecial

Public Member Functions

 CBinds ()
 ~CBinds () override
int Sizeof () const override
void Bind (int KeyId, const char *pStr, bool FreeOnly=false, int ModifierCombination=KeyModifier::NONE)
void SetDefaults ()
void UnbindAll ()
const char * Get (int KeyId, int ModifierCombination) const
const char * Get (const CBindSlot &BindSlot) const
void GetKey (const char *pBindStr, char *pBuf, size_t BufSize) const
void GetKeyBindName (int Key, int ModifierMask, char *pBuf, size_t BufSize) const
void OnConsoleInit () override
bool OnInput (const IInput::CEvent &Event) override
void SetDDRaceBinds (bool FreeOnly)
Public Member Functions inherited from CComponent
virtual void OnStateChange (int NewState, int OldState)
virtual void OnInit ()
virtual void OnShutdown ()
virtual void OnReset ()
virtual void OnWindowResize ()
virtual void OnUpdate ()
virtual void OnRender ()
virtual void OnNewSnapshot ()
virtual void OnRelease ()
virtual void OnMapLoad ()
virtual void OnMessage (int Msg, void *pRawMsg)
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
virtual bool OnTouchState (std::vector< IInput::CTouchFingerState > &vTouchFingerStates)
Public Member Functions inherited from CComponentInterfaces
virtual void OnInterfacesInit (CGameClient *pClient)
virtual ~CComponentInterfaces ()=default

Static Public Member Functions

static int GetModifierMask (IInput *pInput)
static int GetModifierMaskOfKey (int Key)
static const char * GetModifierName (int Modifier)

Public Attributes

bool m_MouseOnAction
CBindsSpecial m_SpecialBinds

Private Member Functions

CBindSlot GetBindSlot (const char *pBindString) const
char * GetKeyBindCommand (int ModifierCombination, int Key) const

Static Private Member Functions

static void ConBind (IConsole::IResult *pResult, void *pUserData)
static void ConBinds (IConsole::IResult *pResult, void *pUserData)
static void ConUnbind (IConsole::IResult *pResult, void *pUserData)
static void ConUnbindAll (IConsole::IResult *pResult, void *pUserData)
static void ConfigSaveCallback (IConfigManager *pConfigManager, void *pUserData)

Private Attributes

char * m_aapKeyBindings [KeyModifier::COMBINATION_COUNT][KEY_LAST]
std::vector< CBindSlot > m_vActiveBinds

Additional Inherited Members

Protected Member Functions inherited from CComponentInterfaces
class CGameClient * GameClient () const
class IClient * Client () const
class IKernel * Kernel () const
class IEngine * Engine () const
class IGraphics * Graphics () const
class ITextRender * TextRender () const
class IInput * Input () const
class IStorage * Storage () const
class CUi * Ui () const
class ISound * Sound () const
class CRenderTools * RenderTools () const
class CRenderMap * RenderMap () const
class IConfigManager * ConfigManager () const
class CConfig * Config () const
class IConsole * Console () const
class IDemoPlayer * DemoPlayer () const
class IDemoRecorder * DemoRecorder (int Recorder) const
class IFavorites * Favorites () const
class IServerBrowser * ServerBrowser () const
class CLayers * Layers () const
class CCollision * Collision () const
int64_t time () const
float LocalTime () const
class IHttp * Http () const

Constructor & Destructor Documentation

◆ CBinds()

CBinds::CBinds ( )

◆ ~CBinds()

CBinds::~CBinds ( )
override

Member Function Documentation

◆ Bind()

void CBinds::Bind ( int KeyId,
const char * pStr,
bool FreeOnly = false,
int ModifierCombination = KeyModifier::NONE )

◆ ConBind()

void CBinds::ConBind ( IConsole::IResult * pResult,
void * pUserData )
staticprivate

◆ ConBinds()

void CBinds::ConBinds ( IConsole::IResult * pResult,
void * pUserData )
staticprivate

◆ ConfigSaveCallback()

void CBinds::ConfigSaveCallback ( IConfigManager * pConfigManager,
void * pUserData )
staticprivate

◆ ConUnbind()

void CBinds::ConUnbind ( IConsole::IResult * pResult,
void * pUserData )
staticprivate

◆ ConUnbindAll()

void CBinds::ConUnbindAll ( IConsole::IResult * pResult,
void * pUserData )
staticprivate

◆ Get() [1/2]

const char * CBinds::Get ( const CBindSlot & BindSlot) const

◆ Get() [2/2]

const char * CBinds::Get ( int KeyId,
int ModifierCombination ) const

◆ GetBindSlot()

CBindSlot CBinds::GetBindSlot ( const char * pBindString) const
private

◆ GetKey()

void CBinds::GetKey ( const char * pBindStr,
char * pBuf,
size_t BufSize ) const

◆ GetKeyBindCommand()

char * CBinds::GetKeyBindCommand ( int ModifierCombination,
int Key ) const
private

◆ GetKeyBindName()

void CBinds::GetKeyBindName ( int Key,
int ModifierMask,
char * pBuf,
size_t BufSize ) const

◆ GetModifierMask()

int CBinds::GetModifierMask ( IInput * pInput)
static

◆ GetModifierMaskOfKey()

int CBinds::GetModifierMaskOfKey ( int Key)
static

◆ GetModifierName()

const char * CBinds::GetModifierName ( int Modifier)
static

◆ OnConsoleInit()

void CBinds::OnConsoleInit ( )
overridevirtual

Called to let the components register their console commands.

Reimplemented from CComponent.

◆ OnInput()

bool CBinds::OnInput ( const IInput::CEvent & Event)
overridevirtual

Called on a input event.

Parameters
EventThe input event.

Reimplemented from CComponent.

◆ SetDDRaceBinds()

void CBinds::SetDDRaceBinds ( bool FreeOnly)

◆ SetDefaults()

void CBinds::SetDefaults ( )

◆ Sizeof()

int CBinds::Sizeof ( ) const
inlineoverridevirtual

Gets the size of the non-abstract component.

Implements CComponent.

◆ UnbindAll()

void CBinds::UnbindAll ( )

Member Data Documentation

◆ m_aapKeyBindings

char* CBinds::m_aapKeyBindings[KeyModifier::COMBINATION_COUNT][KEY_LAST]
private

◆ m_MouseOnAction

bool CBinds::m_MouseOnAction

◆ m_SpecialBinds

CBindsSpecial CBinds::m_SpecialBinds

◆ m_vActiveBinds

std::vector<CBindSlot> CBinds::m_vActiveBinds
private

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