|
| static void | Update (xiiTime timeDifference) |
|
static void | SetInputSlotDisplayName (xiiStringView sInputSlot, xiiStringView sDefaultDisplayName) |
| | Changes the display name of an input slot.
|
|
static xiiStringView | GetInputSlotDisplayName (xiiStringView sInputSlot) |
| | Returns the display name that was assigned to the given input slot.
|
| static xiiStringView | GetInputSlotDisplayName (xiiStringView sInputSet, xiiStringView sAction, xiiInt32 iTrigger=-1) |
| static void | SetInputSlotDeadZone (xiiStringView sInputSlot, float fDeadZone) |
|
static float | GetInputSlotDeadZone (xiiStringView sInputSlot) |
| | Returns the dead zone value for the given input slot.
|
|
static xiiBitflags< xiiInputSlotFlags > | GetInputSlotFlags (xiiStringView sInputSlot) |
| | Returns the flags for the given input slot.
|
| static xiiKeyState::Enum | GetInputSlotState (xiiStringView sInputSlot, float *pValue=nullptr) |
|
static void | RetrieveAllKnownInputSlots (xiiDynamicArray< xiiStringView > &out_inputSlots) |
| | Returns an array that contains all the names of all currently known input slots.
|
| static xiiUInt32 | RetrieveLastCharacter (bool bResetCurrent=true) |
| static void | PollHardware () |
| static void | ClearInputMapping (xiiStringView sInputSet, xiiStringView sInputSlot) |
| static void | SetInputActionConfig (xiiStringView sInputSet, xiiStringView sAction, const xiiInputActionConfig &config, bool bClearPreviousInputMappings) |
| static xiiInputActionConfig | GetInputActionConfig (xiiStringView sInputSet, xiiStringView sAction) |
| static void | RemoveInputAction (xiiStringView sInputSet, xiiStringView sAction) |
| static xiiKeyState::Enum | GetInputActionState (xiiStringView sInputSet, xiiStringView sAction, float *pValue=nullptr, xiiInt8 *pTriggeredSlot=nullptr) |
|
static void | SetActionDisplayName (xiiStringView sAction, xiiStringView sDisplayName) |
| | Sets the display name for the given action.
|
|
static const xiiString | GetActionDisplayName (xiiStringView sAction) |
| | Returns the display name for the given action, or the action name itself, if no special display name was specified yet.
|
|
static void | GetAllInputSets (xiiDynamicArray< xiiString > &out_inputSetNames) |
| | Returns the names of all currently registered input sets.
|
|
static void | GetAllInputActions (xiiStringView sInputSetName, xiiDynamicArray< xiiString > &out_inputActions) |
| | Returns the names of all input actions in the given input set.
|
| static void | SetExclusiveInputSet (xiiStringView sExclusiveSet) |
|
static xiiStringView | GetExclusiveInputSet () |
| | Returns whether any input set gets input exclusively.
|
| static void | InjectInputSlotValue (xiiStringView sInputSlot, float fValue) |
| static xiiStringView | GetPressedInputSlot (xiiInputSlotFlags::Enum mustHaveFlags, xiiInputSlotFlags::Enum mustNotHaveFlags) |
| static xiiStringView | ConvertScanCodeToEngineName (xiiUInt8 uiScanCode, bool bIsExtendedKey) |
| | Mostly for internal use. Converts a scan-code value to the string that is used inside the engine for that key.
|
|
static xiiStringView | GetInputSlotTouchPoint (xiiUInt32 uiIndex) |
| | Helper for retrieving the input slot string for touch point with a given index.
|
|
static xiiStringView | GetInputSlotTouchPointPositionX (xiiUInt32 uiIndex) |
| | Helper for retrieving the input slot string for touch point x position with a given index.
|
|
static xiiStringView | GetInputSlotTouchPointPositionY (xiiUInt32 uiIndex) |
| | Helper for retrieving the input slot string for touch point y position with a given index.
|
|
static xiiEventSubscriptionID | AddEventHandler (xiiEventInput::Handler handler) |
| | Adds an event handler that is called for input events.
|
|
static void | RemoveEventHandler (xiiEventInput::Handler handler) |
| | Removes a previously added event handler.
|
|
static void | RemoveEventHandler (xiiEventSubscriptionID id) |
The central class to set up and query the state of all input.
The xiiInputManager is the central hub through which you can configure which keys will trigger which actions. You can query in which state an action is (inactive (up), active (down), just recently activated (pressed) or just recently deactivated (released)). You can query their values (e.g. how much a thumb-stick or the mouse was moved). Additionally you can localize buttons and actions. The internal data will always use English names and the US keyboard layout, but what with which names those keys are presented to the user can be changed. Although the input manager allows to query the state of each key, button, axis, etc. directly, this is not advised. Instead the user should set up 'actions' and define which keys will trigger those actions. At runtime the user should only query the state of actions. In the best case, an application allows the player to change the mapping which keys are used to trigger which actions.
| void xiiInputManager::InjectInputSlotValue |
( |
xiiStringView | sInputSlot, |
|
|
float | fValue ) |
|
static |
This function allows to 'inject' input state for one frame.
This can be useful to emulate certain keys, e.g. for virtual devices. Note that it usually makes more sense to actually have another input device, however this can be used to get data into the system quickly for when a full blown input device might be overkill. The injected input state is cleared immediately after it has been processed, so to keep a virtual input slot active, the input needs to be injected every frame.
Note that when the input is injected after xiiInputManager::Update was called, its effect will be delayed by one frame.
| void xiiInputManager::PollHardware |
( |
| ) |
|
|
static |
Makes sure that hardware input is processed at this moment, which allows to do this more often than Update() is called.
When you have a game where you are doing relatively few game updates (including processing input), for example only 20 times per second, it is possible to 'miss' input. PollHardware() allows to introduce sampling the hardware state more often to prevent this. E.g. when your renderer renders at 60 Hz, you can poll input also at 60 Hz, even though you really only process it at 20 Hz. In typical usage scenarios this is not required to do and can be ignored. Note that you can call PollHardware() as often as you like and at irregular intervals, it will not have a negative effect on the input states.