DDraceNetwork Docs
|
#include <input.h>
Classes | |
class | CJoystick |
Public Member Functions | |
CInput () | |
void | Init () override |
int | Update () override |
void | Shutdown () override |
void | ConsumeEvents (std::function< void(const CEvent &Event)> Consumer) const override |
void | Clear () override |
float | GetUpdateTime () const override |
bool | ModifierIsPressed () const override |
bool | ShiftIsPressed () const override |
bool | AltIsPressed () const override |
bool | KeyIsPressed (int Key) const override |
bool | KeyPress (int Key) const override |
const char * | KeyName (int Key) const override |
int | FindKeyByName (const char *pKeyName) const override |
size_t | NumJoysticks () const override |
CJoystick * | GetJoystick (size_t Index) override |
CJoystick * | GetActiveJoystick () override |
void | SetActiveJoystick (size_t Index) override |
bool | MouseRelative (float *pX, float *pY) override |
void | MouseModeAbsolute () override |
void | MouseModeRelative () override |
vec2 | NativeMousePos () const override |
bool | NativeMousePressed (int Index) const override |
const std::vector< CTouchFingerState > & | TouchFingerStates () const override |
void | ClearTouchDeltas () override |
std::string | GetClipboardText () override |
void | SetClipboardText (const char *pText) override |
void | StartTextInput () override |
void | StopTextInput () override |
const char * | GetComposition () const override |
bool | HasComposition () const override |
int | GetCompositionCursor () const override |
int | GetCompositionLength () const override |
const char * | GetCandidate (int Index) const override |
int | GetCandidateCount () const override |
int | GetCandidateSelectedIndex () const override |
void | SetCompositionWindowPosition (float X, float Y, float H) override |
bool | GetDropFile (char *aBuf, int Len) override |
virtual void | Init ()=0 |
virtual void | Shutdown () override=0 |
virtual int | Update ()=0 |
Public Member Functions inherited from IInput | |
virtual void | ConsumeEvents (std::function< void(const CEvent &Event)> Consumer) const =0 |
virtual void | Clear ()=0 |
virtual float | GetUpdateTime () const =0 |
virtual bool | ModifierIsPressed () const =0 |
virtual bool | ShiftIsPressed () const =0 |
virtual bool | AltIsPressed () const =0 |
virtual bool | KeyIsPressed (int Key) const =0 |
virtual bool | KeyPress (int Key) const =0 |
virtual const char * | KeyName (int Key) const =0 |
virtual int | FindKeyByName (const char *pKeyName) const =0 |
virtual size_t | NumJoysticks () const =0 |
virtual IJoystick * | GetJoystick (size_t Index)=0 |
virtual IJoystick * | GetActiveJoystick ()=0 |
virtual void | SetActiveJoystick (size_t Index)=0 |
virtual vec2 | NativeMousePos () const =0 |
virtual bool | NativeMousePressed (int Index) const =0 |
virtual void | MouseModeRelative ()=0 |
virtual void | MouseModeAbsolute ()=0 |
virtual bool | MouseRelative (float *pX, float *pY)=0 |
virtual const std::vector< CTouchFingerState > & | TouchFingerStates () const =0 |
virtual void | ClearTouchDeltas ()=0 |
virtual std::string | GetClipboardText ()=0 |
virtual void | SetClipboardText (const char *pText)=0 |
virtual void | StartTextInput ()=0 |
virtual void | StopTextInput ()=0 |
virtual const char * | GetComposition () const =0 |
virtual bool | HasComposition () const =0 |
virtual int | GetCompositionCursor () const =0 |
virtual int | GetCompositionLength () const =0 |
virtual const char * | GetCandidate (int Index) const =0 |
virtual int | GetCandidateCount () const =0 |
virtual int | GetCandidateSelectedIndex () const =0 |
virtual void | SetCompositionWindowPosition (float X, float Y, float H)=0 |
virtual bool | GetDropFile (char *aBuf, int Len)=0 |
ECursorType | CursorRelative (float *pX, float *pY) |
Public Member Functions inherited from IInterface | |
IInterface () | |
virtual void | Shutdown () |
virtual | ~IInterface () |
Private Member Functions | |
IEngineGraphics * | Graphics () const |
IConsole * | Console () const |
void | InitJoysticks () |
bool | OpenJoystick (int JoystickIndex) |
void | CloseJoysticks () |
void | UpdateActiveJoystick () |
float | GetJoystickDeadzone () |
void | AddKeyEvent (int Key, int Flags) |
void | AddTextEvent (const char *pText) |
void | HandleJoystickAxisMotionEvent (const SDL_JoyAxisEvent &Event) |
void | HandleJoystickButtonEvent (const SDL_JoyButtonEvent &Event) |
void | HandleJoystickHatMotionEvent (const SDL_JoyHatEvent &Event) |
void | HandleJoystickAddedEvent (const SDL_JoyDeviceEvent &Event) |
void | HandleJoystickRemovedEvent (const SDL_JoyDeviceEvent &Event) |
void | HandleTouchDownEvent (const SDL_TouchFingerEvent &Event) |
void | HandleTouchUpEvent (const SDL_TouchFingerEvent &Event) |
void | HandleTouchMotionEvent (const SDL_TouchFingerEvent &Event) |
void | HandleTextEditingEvent (const char *pText, int Start, int Length) |
void | ProcessSystemMessage (SDL_SysWMmsg *pMsg) |
Static Private Member Functions | |
static void | ConchainJoystickGuidChanged (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) |
Private Attributes | |
IEngineGraphics * | m_pGraphics |
IConsole * | m_pConsole |
IConfigManager * | m_pConfigManager |
std::vector< CJoystick > | m_vJoysticks |
CJoystick * | m_pActiveJoystick = nullptr |
bool | m_InputGrabbed |
bool | m_MouseFocus |
std::string | m_CompositionString |
int | m_CompositionCursor |
std::vector< std::string > | m_vCandidates |
int | m_CandidateSelectedIndex |
std::vector< CEvent > | m_vInputEvents |
int64_t | m_LastUpdate |
float | m_UpdateTime |
bool | m_aCurrentKeyStates [KEY_LAST] |
bool | m_aFrameKeyStates [KEY_LAST] |
uint32_t | m_InputCounter |
std::vector< CTouchFingerState > | m_vTouchFingerStates |
char | m_aDropFile [IO_MAX_PATH_LENGTH] |
Additional Inherited Members | |
Public Types inherited from IInput | |
enum | { FLAG_PRESS = 1 << 0 , FLAG_RELEASE = 1 << 1 , FLAG_TEXT = 1 << 2 } |
enum | ECursorType { CURSOR_NONE , CURSOR_MOUSE , CURSOR_JOYSTICK } |
Static Public Member Functions inherited from IEngineInput | |
static const char * | InterfaceName () |
Static Public Member Functions inherited from IInput | |
static const char * | InterfaceName () |
Protected Member Functions inherited from IInterface | |
IKernel * | Kernel () |
CInput::CInput | ( | ) |
|
private |
|
private |
|
inlineoverridevirtual |
Implements IInput.
|
overridevirtual |
|
overridevirtual |
Must be called after the touch finger states have been used during the client update to ensure that touch deltas are only accumulated until the next update. If the touch states are only used during rendering, i.e. for user interfaces, then this is called automatically by calling Clear.
Implements IInput.
|
private |
|
staticprivate |
|
inlineprivate |
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
private |
|
overridevirtual |
Implements IInput.
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inlineoverridevirtual |
Implements IInput.
|
overridevirtual |
Implements IEngineInput.
|
private |
|
overridevirtual |
Returns whether the given key is currently pressed down. This directly represents the state of pressed keys based on all handled input events.
This function should be used to trigger behavior continuously while a specific key is held down, e.g. for showing a list of all keys that are currently being pressed.
Key | The key code (see keys.h ). |
true
if key is currently pressed down, false
otherwise. Implements IInput.
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Returns whether the given key was pressed down during input updates for current frame. This state is cleared at the end of each frame by calling the Clear function.
This function should be used to trigger behavior only once per key press event per frame, e.g. for menu hotkeys that should activate behavior once per key press.
Key | The key code (see keys.h ). |
true
if key was pressed down during input updates for the current frame, false
otherwise. Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
private |
|
private |
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
inlineoverridevirtual |
Implements IInput.
|
overridevirtual |
Implements IEngineInput.
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Implements IInput.
|
overridevirtual |
Returns a vector of the states of all touch fingers currently being pressed down on touch devices. Note that this only contains fingers which are pressed down, i.e. released fingers are never stored. The order of the fingers in this vector is based on the order in which the fingers where pressed.
Implements IInput.
|
overridevirtual |
Implements IEngineInput.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |