Gainput  v1.0.0
GainputInputListener.h
1 
2 #ifndef GAINPUTINPUTLISTENER_H_
3 #define GAINPUTINPUTLISTENER_H_
4 
5 namespace gainput
6 {
7 
9 class GAINPUT_LIBEXPORT InputListener
10 {
11 public:
12  virtual ~InputListener() { }
13 
15 
22  virtual bool OnDeviceButtonBool(DeviceId device, DeviceButtonId deviceButton, bool oldValue, bool newValue) { GAINPUT_UNUSED(device); GAINPUT_UNUSED(deviceButton); GAINPUT_UNUSED(oldValue); GAINPUT_UNUSED(newValue); return true; }
23 
25 
32  virtual bool OnDeviceButtonFloat(DeviceId device, DeviceButtonId deviceButton, float oldValue, float newValue) { GAINPUT_UNUSED(device); GAINPUT_UNUSED(deviceButton); GAINPUT_UNUSED(oldValue); GAINPUT_UNUSED(newValue); return true; }
33 
35 
38  virtual int GetPriority() const { return 0; }
39 };
40 
41 
43 class GAINPUT_LIBEXPORT MappedInputListener
44 {
45 public:
46  virtual ~MappedInputListener() { }
47 
49 
55  virtual bool OnUserButtonBool(UserButtonId userButton, bool oldValue, bool newValue) { GAINPUT_UNUSED(userButton); GAINPUT_UNUSED(oldValue); GAINPUT_UNUSED(newValue); return true; }
56 
58 
64  virtual bool OnUserButtonFloat(UserButtonId userButton, float oldValue, float newValue) { GAINPUT_UNUSED(userButton); GAINPUT_UNUSED(oldValue); GAINPUT_UNUSED(newValue); return true; }
65 
67 
70  virtual int GetPriority() const { return 0; }
71 
72 };
73 
74 }
75 
76 #endif
77 
Listener interface that allows to receive notifications when user button states change.
Definition: GainputInputListener.h:43
virtual bool OnUserButtonBool(UserButtonId userButton, bool oldValue, bool newValue)
Called when a bool-type button state changes.
Definition: GainputInputListener.h:55
virtual int GetPriority() const
Returns the priority which influences the order in which listeners are called by InputMap.
Definition: GainputInputListener.h:70
virtual int GetPriority() const
Returns the priority which influences the order in which listeners are called by InputManager.
Definition: GainputInputListener.h:38
unsigned int UserButtonId
ID of a user-defined, mapped button.
Definition: gainput.h:121
virtual bool OnDeviceButtonBool(DeviceId device, DeviceButtonId deviceButton, bool oldValue, bool newValue)
Called when a bool-type button state changes.
Definition: GainputInputListener.h:22
Listener interface that allows to receive notifications when device button states change...
Definition: GainputInputListener.h:9
unsigned int DeviceId
ID of an input device.
Definition: gainput.h:107
virtual bool OnDeviceButtonFloat(DeviceId device, DeviceButtonId deviceButton, float oldValue, float newValue)
Called when a float-type button state changes.
Definition: GainputInputListener.h:32
virtual bool OnUserButtonFloat(UserButtonId userButton, float oldValue, float newValue)
Called when a float-type button state changes.
Definition: GainputInputListener.h:64
unsigned int DeviceButtonId
ID of a specific button unique to an input device.
Definition: gainput.h:109
Contains all Gainput related classes, types, and functions.
Definition: gainput.h:103