IInput

#include

Public Member Functions

virtual void AddEventListener (IInputEventListener *pListener)=0
Registers new input events listener.
virtual void RemoveEventListener (IInputEventListener *pListener)=0
virtual void AddConsoleEventListener (IInputEventListener *pListener)=0
Registers new console input event listeners. console input listeners receive all events, no matter what.
virtual void RemoveConsoleEventListener (IInputEventListener *pListener)=0
virtual bool AddTouchEventListener (ITouchEventListener *pListener, const char *name)=0
virtual void RemoveTouchEventListener (ITouchEventListener *pListener)=0
virtual void SetExclusiveListener (IInputEventListener *pListener)=0
Registers an exclusive listener which has the ability to filter out events before they arrive at the normal listeners.
virtual IInputEventListener * GetExclusiveListener ()=0
virtual bool AddInputDevice (IInputDevice *pDevice)=0
virtual void EnableEventPosting (bool bEnable)=0
virtual bool IsEventPostingEnabled () const =0
virtual void PostInputEvent (const SInputEvent &event, bool bForce=false)=0
virtual void PostTouchEvent (const STouchEvent &event, bool bForce=false)=0
virtual void PostUnicodeEvent (const SUnicodeEvent &event, bool bForce=false)=0
virtual void ProcessKey (uint32 key, bool pressed, wchar_t unicode, bool repeat)=0
virtual void ForceFeedbackEvent (const SFFOutputEvent &event)=0
Posts a force feedback / rumble output event.
virtual void ForceFeedbackSetDeviceIndex (int index)=0
Sets a filter so that only one device can output force feedback.
virtual bool Init ()=0
virtual void PostInit ()=0
Post Initialization called at end of initialization.
virtual void Update (bool bFocus)=0
Updates Keyboard, Mouse and Joystick. Sets bFocus to true if window has focus and input is enabled.
virtual void ShutDown ()=0
Clears all subsystems.
virtual void SetExclusiveMode (EInputDeviceType deviceType, bool exclusive, void *hwnd=0)=0
virtual bool InputState (const TKeyName &key, EInputState state)=0
virtual const char * GetKeyName (const SInputEvent &event) const =0
virtual const char * GetKeyName (EKeyId keyId) const =0
virtual uint32 GetInputCharUnicode (const SInputEvent &event)=0
virtual SInputSymbol * LookupSymbol (EInputDeviceType deviceType, int deviceIndex, EKeyId keyId)=0
Lookups a symbol for a given symbol and key ids.
virtual const SInputSymbol * GetSymbolByName (const char *name) const =0
Looks up a symbol for a key name.
virtual const char * GetOSKeyName (const SInputEvent &event)=0
virtual void ClearKeyState ()=0
Clears key states of all devices.
virtual void ClearAnalogKeyState ()=0
Clears analog key states of all devices.
virtual void RetriggerKeyState ()=0
virtual bool Retriggering ()=0
virtual bool HasInputDeviceOfType (EInputDeviceType type)=0
Queries to see if this machine has some kind of input device connected.
virtual int GetModifiers () const =0
Gets the currently pressed modifiers.
virtual void EnableDevice (EInputDeviceType deviceType, bool enable)=0
Tells devices whether to report input or not.
virtual void SetDeadZone (float fThreshold)=0
virtual void RestoreDefaultDeadZone ()=0
virtual IInputDevice * GetDevice (uint16 id, EInputDeviceType deviceType)=0
virtual uint32 GetPlatformFlags () const =0
Returns EInputPlatformFlags.
virtual bool SetBlockingInput (const SInputBlockData &inputBlockData)=0
virtual bool RemoveBlockingInput (const SInputBlockData &inputBlockData)=0
virtual bool HasBlockingInput (const SInputBlockData &inputBlockData) const =0
virtual int GetNumBlockingInputs () const =0
virtual void ClearBlockingInputs ()=0
Clears all the inputs being blocked.
virtual bool ShouldBlockInputEventPosting (const EKeyId keyId, const EInputDeviceType deviceType, const uint8 deviceIndex) const =0
virtual int ShowCursor (const bool bShow)=0
virtual IKinectInput * GetKinectInput ()=0
virtual INaturalPointInput * GetNaturalPointInput ()=0
virtual bool GrabInput (bool bGrab)=0

Public Attributes

bool(* OnFilterInputEvent )(SInputEvent *)

Detailed Description

Interface to the low-level Input system. The input system give access and initialize Keyboard,Mouse and Joystick SubSystems.

Member Function Documentation

◆ GetDevice()

virtual IInputDevice* IInput::GetDevice ( uint16 id,
EInputDeviceType deviceType
)
pure virtual

Gets the device at an index for a specific Type.

Returns
Pointer to device, or NULL if not found/valid.

◆ GetInputCharUnicode()

virtual uint32 IInput::GetInputCharUnicode ( const SInputEvent & event)
pure virtual

Gets an input char translated to unicode from the event. The function should internally dispatch to all managed input devices and return the first recognized event.

Parameters
eventInput event to translate into a name.

◆ GetKeyName() [1/2]

virtual const char* IInput::GetKeyName ( const SInputEvent & event) const
pure virtual

Converts an input event to the key name. The function should internally dispatch to all managed input devices and return the first recognized event.

Parameters
eventInput event to translate into a name.

◆ GetKeyName() [2/2]

virtual const char* IInput::GetKeyName ( EKeyId keyId) const
pure virtual

Converts an input event to the key name. The function should internally dispatch to all managed input devices and return the first recognized keyId.

Parameters
keyIdInput keyId to translate into a name.
Returns
Translated key name.

◆ GetNumBlockingInputs()

virtual int IInput::GetNumBlockingInputs ( ) const
pure virtual

Gets the number of inputs currently being blocked.

Returns
Number of inputs currently being blocked.

◆ GetOSKeyName()

virtual const char* IInput::GetOSKeyName ( const SInputEvent & event)
pure virtual

Gets OS Keyname.

Parameters
eventInput event to translate into a name.

◆ HasBlockingInput()

virtual bool IInput::HasBlockingInput ( const SInputBlockData & inputBlockData) const
pure virtual

Checks if the specified input is currently being blocked.

Returns
true if specified input is currently being blocked, false otherwise.

◆ Init()

virtual bool IInput::Init ( )
pure virtual

Initializes input system.

Note
Required params should be passed through constructor.

◆ InputState()

virtual bool IInput::InputState ( const TKeyName & key,
EInputState state
)
pure virtual

◆ ProcessKey()

virtual void IInput::ProcessKey ( uint32 key,
bool pressed,
wchar_t unicode,
bool repeat
)
pure virtual

For direct key processing (e.g. win proc functions). Currently only used by durango metro launcher.

◆ RemoveBlockingInput()

virtual bool IInput::RemoveBlockingInput ( const SInputBlockData & inputBlockData)
pure virtual

Removes blocking input.

Returns
True if found and removed, false otherwise.

◆ Retriggering()

virtual bool IInput::Retriggering ( )
pure virtual

Gets if we are currently re-triggering.

Note
Needed to filter out actions.

◆ RetriggerKeyState()

virtual void IInput::RetriggerKeyState ( )
pure virtual

Re-triggers pressed keys.

Note
Used for transitioning action maps.

◆ SetBlockingInput()

virtual bool IInput::SetBlockingInput ( const SInputBlockData & inputBlockData)
pure virtual

Adds or updates blocking input if SInputBlockData::fBlockDuration exceeds previously blocking time.

Returns
true if successfully added inputBlocker or updated existed input blocker's remaining blocking time.

◆ SetDeadZone()

virtual void IInput::SetDeadZone ( float fThreshold)
pure virtual

Dead zone settings for input devices where this is relevant (i.e. controllers with analog sticks).

Parameters
fThresholdBetween 0 and 1.

◆ SetExclusiveMode()

virtual void IInput::SetExclusiveMode ( EInputDeviceType deviceType,
bool exclusive,
void * hwnd = 0
)
pure virtual
See also
IInputDevice::SetExclusive

◆ ShouldBlockInputEventPosting()

virtual bool IInput::ShouldBlockInputEventPosting ( const EKeyId keyId,
const EInputDeviceType deviceType,
const uint8 deviceIndex
) const
pure virtual

Checks if the input specified should be blocked.

Returns
True if input specified should be blocked, false otherwise.

◆ ShowCursor()

virtual int IInput::ShowCursor ( const bool bShow)
pure virtual

Show or hide the mouse cursor

Returns
Internal display count. Cursor is visible if the display count is greater or equal to zero.

Member Data Documentation

◆ OnFilterInputEvent

bool(* IInput::OnFilterInputEvent) (SInputEvent *)

Allows for Sandbox to intercept and modify events prior to system wide sending.

Returns
True if the event is supposed to be broadcasted.