OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4KeyCBPassKey< TargetClass > Class Template Reference

#include <C4KeyboardInput.h>

Inheritance diagram for C4KeyCBPassKey< TargetClass >:
[legend]
Collaboration diagram for C4KeyCBPassKey< TargetClass >:
[legend]

Public Types

typedef bool(TargetClass::* CallbackFunc )(const C4KeyCodeEx &key)
 

Public Member Functions

 C4KeyCBPassKey (TargetClass &rTarget, CallbackFunc pFuncDown, CallbackFunc pFuncUp=nullptr, CallbackFunc pFuncPressed=nullptr, CallbackFunc pFuncMoved=nullptr)
 
void Ref ()
 
void Deref ()
 
bool IsOriginalKey (const class C4CustomKey *pCheckKey) const
 

Public Attributes

class C4CustomKeypOriginalKey
 

Protected Member Functions

virtual bool OnKeyEvent (const C4KeyCodeEx &key, C4KeyEventType eEv)
 
virtual bool CheckCondition ()
 

Protected Attributes

TargetClass & rTarget
 
CallbackFunc pFuncDown
 
CallbackFunc pFuncUp
 
CallbackFunc pFuncPressed
 
CallbackFunc pFuncMoved
 

Detailed Description

template<class TargetClass>
class C4KeyCBPassKey< TargetClass >

Definition at line 329 of file C4KeyboardInput.h.

Member Typedef Documentation

template<class TargetClass >
typedef bool(TargetClass::* C4KeyCBPassKey< TargetClass >::CallbackFunc)(const C4KeyCodeEx &key)

Definition at line 332 of file C4KeyboardInput.h.

Constructor & Destructor Documentation

template<class TargetClass >
C4KeyCBPassKey< TargetClass >::C4KeyCBPassKey ( TargetClass &  rTarget,
CallbackFunc  pFuncDown,
CallbackFunc  pFuncUp = nullptr,
CallbackFunc  pFuncPressed = nullptr,
CallbackFunc  pFuncMoved = nullptr 
)
inline

Definition at line 355 of file C4KeyboardInput.h.

Member Function Documentation

template<class TargetClass >
virtual bool C4KeyCBPassKey< TargetClass >::CheckCondition ( )
inlineprotectedvirtual

Reimplemented in C4GUI::DlgKeyCBPassKey< TargetClass >.

Definition at line 352 of file C4KeyboardInput.h.

Referenced by C4KeyCBPassKey< TargetClass >::OnKeyEvent().

352 { return true; }

Here is the caller graph for this function:

void C4KeyboardCallbackInterface::Deref ( )
inlineinherited

Definition at line 289 of file C4KeyboardInput.h.

Referenced by C4CustomKey::KillCallbacks().

289 { if (!--iRef) delete this; }

Here is the caller graph for this function:

bool C4KeyboardCallbackInterface::IsOriginalKey ( const class C4CustomKey pCheckKey) const
inlineinherited

Definition at line 294 of file C4KeyboardInput.h.

References C4KeyboardCallbackInterface::pOriginalKey.

Referenced by C4KeyboardCallbackInterfaceHasOriginalKey().

294 { return pCheckKey == pOriginalKey; }
class C4CustomKey * pOriginalKey

Here is the caller graph for this function:

template<class TargetClass >
virtual bool C4KeyCBPassKey< TargetClass >::OnKeyEvent ( const C4KeyCodeEx key,
C4KeyEventType  eEv 
)
inlineprotectedvirtual

Implements C4KeyboardCallbackInterface.

Definition at line 339 of file C4KeyboardInput.h.

References C4KeyCBPassKey< TargetClass >::CheckCondition(), KEYEV_Down, KEYEV_Moved, KEYEV_Pressed, KEYEV_Up, C4KeyCBPassKey< TargetClass >::pFuncDown, C4KeyCBPassKey< TargetClass >::pFuncMoved, C4KeyCBPassKey< TargetClass >::pFuncPressed, and C4KeyCBPassKey< TargetClass >::pFuncUp.

340  {
341  if (!CheckCondition()) return false;
342  switch (eEv)
343  {
344  case KEYEV_Down: return pFuncDown ? (rTarget.*pFuncDown)(key) : false;
345  case KEYEV_Up: return pFuncUp ? (rTarget.*pFuncUp)(key) : false;
346  case KEYEV_Pressed: return pFuncPressed ? (rTarget.*pFuncPressed)(key) : false;
347  case KEYEV_Moved: return pFuncMoved ? (rTarget.*pFuncMoved)(key) : false;
348  default: return false;
349  }
350  }
TargetClass & rTarget
CallbackFunc pFuncDown
CallbackFunc pFuncPressed
virtual bool CheckCondition()
CallbackFunc pFuncMoved
CallbackFunc pFuncUp

Here is the call graph for this function:

void C4KeyboardCallbackInterface::Ref ( )
inlineinherited

Definition at line 288 of file C4KeyboardInput.h.

Referenced by C4CustomKey::C4CustomKey().

288 { ++iRef; }

Here is the caller graph for this function:

Member Data Documentation

template<class TargetClass >
CallbackFunc C4KeyCBPassKey< TargetClass >::pFuncDown
protected

Definition at line 336 of file C4KeyboardInput.h.

Referenced by C4KeyCBPassKey< TargetClass >::OnKeyEvent().

template<class TargetClass >
CallbackFunc C4KeyCBPassKey< TargetClass >::pFuncMoved
protected

Definition at line 336 of file C4KeyboardInput.h.

Referenced by C4KeyCBPassKey< TargetClass >::OnKeyEvent().

template<class TargetClass >
CallbackFunc C4KeyCBPassKey< TargetClass >::pFuncPressed
protected

Definition at line 336 of file C4KeyboardInput.h.

Referenced by C4KeyCBPassKey< TargetClass >::OnKeyEvent().

template<class TargetClass >
CallbackFunc C4KeyCBPassKey< TargetClass >::pFuncUp
protected

Definition at line 336 of file C4KeyboardInput.h.

Referenced by C4KeyCBPassKey< TargetClass >::OnKeyEvent().

class C4CustomKey* C4KeyboardCallbackInterface::pOriginalKey
inherited
template<class TargetClass >
TargetClass& C4KeyCBPassKey< TargetClass >::rTarget
protected

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