![]() |
DDNet documentation
|
#include <input.h>
Classes | |
| class | CEvent |
| class | IJoystick |
| class | CTouchFinger |
| class | CTouchFingerState |
Public Types | |
| enum | { FLAG_PRESS = 1 << 0 , FLAG_RELEASE = 1 << 1 , FLAG_TEXT = 1 << 2 , FLAG_REPEAT = 1 << 3 } |
| enum | ECursorType { CURSOR_NONE , CURSOR_MOUSE , CURSOR_JOYSTICK } |
Public Member Functions | |
| 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 void | EnsureScreenKeyboardShown ()=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 ()=default |
Static Public Member Functions | |
| static const char * | InterfaceName () |
Additional Inherited Members | |
| Protected Member Functions inherited from IInterface | |
| IKernel * | Kernel () |
| anonymous enum |
| Enumerator | |
|---|---|
| FLAG_PRESS | |
| FLAG_RELEASE | |
| FLAG_TEXT | |
| FLAG_REPEAT | Combined with FLAG_PRESS for key press events that are being repeated when a key is held down. |
| enum IInput::ECursorType |
|
pure virtual |
Implemented in CInput.
|
pure virtual |
|
pure virtual |
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.
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
inline |
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
inlinestatic |
|
pure virtual |
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). |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
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). |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
Implemented in CInput.
|
pure virtual |
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.
Implemented in CInput.