#include <C4KeyboardInput.h>
Public Member Functions | |
StdStrBuf | ToString (bool fHumanReadable, bool fShort) const |
bool | operator< (const C4KeyCodeEx &v2) const |
bool | operator== (const C4KeyCodeEx &v2) const |
void | CompileFunc (StdCompiler *pComp, StdStrBuf *pOutBuf=nullptr) |
C4KeyCodeEx (C4KeyCode Key=KEY_Default, DWORD Shift=KEYS_None, bool fIsRepeated=false, int32_t deviceId=-1) | |
bool | IsRepeated () const |
void | FixShiftKeys () |
Static Public Member Functions | |
static C4KeyShiftState | String2KeyShift (const StdStrBuf &sName) |
static C4KeyCode | String2KeyCode (const StdStrBuf &sName) |
static StdStrBuf | KeyCode2String (C4KeyCode wCode, bool fHumanReadable, bool fShort) |
static StdStrBuf | KeyShift2String (C4KeyShiftState eShift) |
static C4KeyCodeEx | FromC4MC (int8_t mouse_id, int32_t button, DWORD param, bool *is_down=nullptr) |
Public Attributes | |
C4KeyCode | Key |
DWORD | dwShift |
int32_t | deviceId |
bool | fRepeated |
Definition at line 201 of file C4KeyboardInput.h.
C4KeyCodeEx::C4KeyCodeEx | ( | C4KeyCode | Key = KEY_Default , |
DWORD | Shift = KEYS_None , |
||
bool | fIsRepeated = false , |
||
int32_t | deviceId = -1 |
||
) |
Definition at line 190 of file C4KeyboardInput.cpp.
void C4KeyCodeEx::CompileFunc | ( | StdCompiler * | pComp, |
StdStrBuf * | pOutBuf = nullptr |
||
) |
Definition at line 519 of file C4KeyboardInput.cpp.
References StdStrBuf::Copy(), dwShift, StdCompiler::excCorrupt(), FormatString(), StdStrBuf::getData(), StdStrBuf::getLength(), StdCompiler::isDeserializer(), Key, KEY_Default, KEY_Undefined, KeyCode2String(), KEYS_First, KEYS_Max, KEYS_Undefined, KeyShift2String(), mkDecompileAdapt(), mkParAdapt(), StdCompiler::NoSeparator(), StdCompiler::RCT_Idtf, StdCompiler::SEP_DOLLAR, StdCompiler::SEP_PLUS, StdCompiler::Separator(), String2KeyCode(), String2KeyShift(), StdStrBuf::Take(), ToString(), and StdCompiler::Value().
void C4KeyCodeEx::FixShiftKeys | ( | ) |
Definition at line 233 of file C4KeyboardInput.cpp.
References dwShift, Key, KEYS_Alt, KEYS_Control, and KEYS_Shift.
Referenced by C4Game::DoKeyboardInput().
|
static |
Definition at line 195 of file C4KeyboardInput.cpp.
References C4MC_Button_LeftDouble, C4MC_Button_LeftDown, C4MC_Button_LeftUp, C4MC_Button_MiddleDouble, C4MC_Button_MiddleDown, C4MC_Button_MiddleUp, C4MC_Button_None, C4MC_Button_RightDouble, C4MC_Button_RightDown, C4MC_Button_RightUp, C4MC_Button_Wheel, C4MC_Button_X1Double, C4MC_Button_X1Down, C4MC_Button_X1Up, C4MC_Button_X2Double, C4MC_Button_X2Down, C4MC_Button_X2Up, KEY_Mouse(), KEY_MOUSE_ButtonLeft, KEY_MOUSE_ButtonLeftDouble, KEY_MOUSE_ButtonMiddle, KEY_MOUSE_ButtonMiddleDouble, KEY_MOUSE_ButtonRight, KEY_MOUSE_ButtonRightDouble, KEY_MOUSE_ButtonX1, KEY_MOUSE_ButtonX1Double, KEY_MOUSE_ButtonX2, KEY_MOUSE_ButtonX2Double, KEY_MOUSE_Move, KEY_MOUSE_Wheel1Down, KEY_MOUSE_Wheel1Up, KEYS_Alt, KEYS_Control, KEYS_None, and KEYS_Shift.
Referenced by C4PlayerControl::DoMouseInput().
|
inline |
Definition at line 364 of file C4KeyboardInput.cpp.
References KEY_CONTROLLER_AnyButton, KEY_CONTROLLER_AxisLeftXLeft, KEY_CONTROLLER_AxisLeftXRight, KEY_CONTROLLER_AxisLeftYDown, KEY_CONTROLLER_AxisLeftYUp, KEY_CONTROLLER_AxisRightXLeft, KEY_CONTROLLER_AxisRightXRight, KEY_CONTROLLER_AxisRightYDown, KEY_CONTROLLER_AxisRightYUp, KEY_CONTROLLER_AxisTriggerLeft, KEY_CONTROLLER_AxisTriggerRight, KEY_CONTROLLER_ButtonA, KEY_CONTROLLER_ButtonB, KEY_CONTROLLER_ButtonBack, KEY_CONTROLLER_ButtonDpadDown, KEY_CONTROLLER_ButtonDpadLeft, KEY_CONTROLLER_ButtonDpadRight, KEY_CONTROLLER_ButtonDpadUp, KEY_CONTROLLER_ButtonGuide, KEY_CONTROLLER_ButtonLeftShoulder, KEY_CONTROLLER_ButtonLeftStick, KEY_CONTROLLER_ButtonRightShoulder, KEY_CONTROLLER_ButtonRightStick, KEY_CONTROLLER_ButtonStart, KEY_CONTROLLER_ButtonX, KEY_CONTROLLER_ButtonY, Key_GetGamepadEvent(), and Key_IsGamepad().
Referenced by CompileFunc(), and ToString().
|
static |
Definition at line 61 of file C4KeyboardInput.cpp.
References C4KeyShiftMapEntry::eShift, KeyShiftMap, and C4KeyShiftMapEntry::szName.
Referenced by CompileFunc(), and ToString().
|
inline |
|
inline |
Definition at line 279 of file C4KeyboardInput.cpp.
References StdStrBuf::getData(), and StdStrBuf::getLength().
Referenced by CompileFunc().
|
static |
Definition at line 52 of file C4KeyboardInput.cpp.
References C4KeyShiftMapEntry::eShift, StdStrBuf::getData(), KeyShiftMap, SEqualNoCase(), and C4KeyShiftMapEntry::szName.
Referenced by CompileFunc().
StdStrBuf C4KeyCodeEx::ToString | ( | bool | fHumanReadable, |
bool | fShort | ||
) | const |
Definition at line 492 of file C4KeyboardInput.cpp.
References StdStrBuf::Append(), StdStrBuf::AppendChar(), StdStrBuf::Clear(), dwShift, StdStrBuf::getLength(), Key, KeyCode2String(), KEYS_First, KEYS_Max, and KeyShift2String().
Referenced by CompileFunc(), and C4KeyboardInput::GetKeyCodeNameByKeyName().
int32_t C4KeyCodeEx::deviceId |
Definition at line 206 of file C4KeyboardInput.h.
DWORD C4KeyCodeEx::dwShift |
Definition at line 204 of file C4KeyboardInput.h.
Referenced by CompileFunc(), C4KeyboardInput::DoInput(), FixShiftKeys(), C4PlayerControlAssignmentSet::GetAssignmentsByKey(), operator<(), operator==(), and ToString().
bool C4KeyCodeEx::fRepeated |
Definition at line 210 of file C4KeyboardInput.h.
Referenced by IsRepeated().
C4KeyCode C4KeyCodeEx::Key |
Definition at line 203 of file C4KeyboardInput.h.
Referenced by C4CustomKey::C4CustomKey(), CompileFunc(), C4KeyboardInput::DoInput(), FixShiftKeys(), C4PlayerControlAssignmentSet::GetAssignmentsByKey(), C4PlayerControlAssignment::IsComboMatched(), operator<(), operator==(), C4PlayerControlAssignment::ResolveRefs(), and ToString().