Gainput  v1.0.0
Public Member Functions | List of all members
gainput::InputListener Class Reference

Listener interface that allows to receive notifications when device button states change. More...

#include <GainputInputListener.h>

Public Member Functions

virtual bool OnDeviceButtonBool (DeviceId device, DeviceButtonId deviceButton, bool oldValue, bool newValue)
 Called when a bool-type button state changes. More...
 
virtual bool OnDeviceButtonFloat (DeviceId device, DeviceButtonId deviceButton, float oldValue, float newValue)
 Called when a float-type button state changes. More...
 
virtual int GetPriority () const
 Returns the priority which influences the order in which listeners are called by InputManager. More...
 

Detailed Description

Listener interface that allows to receive notifications when device button states change.

Examples:
/samples/listener/listenersample.cpp, /samples/recording/recordingsample.cpp, and /samples/sync/syncsample.cpp.

Member Function Documentation

◆ GetPriority()

virtual int gainput::InputListener::GetPriority ( ) const
inlinevirtual

Returns the priority which influences the order in which listeners are called by InputManager.

See also
InputManager::ReorderListeners()
Examples:
/samples/listener/listenersample.cpp.

◆ OnDeviceButtonBool()

virtual bool gainput::InputListener::OnDeviceButtonBool ( DeviceId  device,
DeviceButtonId  deviceButton,
bool  oldValue,
bool  newValue 
)
inlinevirtual

Called when a bool-type button state changes.

Parameters
deviceThe input device's ID the state change occurred on.
deviceButtonThe ID of the device button that changed.
oldValuePrevious state of the button.
newValueNew state of the button.
Returns
true if the button may be processed by listeners with a lower priority, false otherwise.
Examples:
/samples/listener/listenersample.cpp, /samples/recording/recordingsample.cpp, and /samples/sync/syncsample.cpp.

◆ OnDeviceButtonFloat()

virtual bool gainput::InputListener::OnDeviceButtonFloat ( DeviceId  device,
DeviceButtonId  deviceButton,
float  oldValue,
float  newValue 
)
inlinevirtual

Called when a float-type button state changes.

Parameters
deviceThe input device's ID the state change occurred on.
deviceButtonThe ID of the device button that changed.
oldValuePrevious state of the button.
newValueNew state of the button.
Returns
true if the button may be processed by listeners with a lower priority, false otherwise.
Examples:
/samples/listener/listenersample.cpp, /samples/recording/recordingsample.cpp, and /samples/sync/syncsample.cpp.

The documentation for this class was generated from the following file: