Interface for implementing a InputDevice source. More...
#include <input_device_provider.h>
Public Member Functions | |
virtual | ~InputDeviceProvider () |
virtual float | get_axis (int index) const |
Returns the the current position of a joystick axis. (Joysticks only) More... | |
virtual std::vector< int > | get_axis_ids () const |
Returns the number of axes available on this device. (Joysticks only) More... | |
virtual int | get_button_count () const =0 |
Returns the number of buttons available on this device. If used on a keyboard or mouse, this function returns -1. More... | |
virtual std::string | get_device_name () const =0 |
Return the hardware id/device for this device (i.e. /dev/input/js0) More... | |
virtual Point | get_device_position () const |
Returns the current device-supplied x and y position of the device. (Pointing devices only) The returned positional value is in the scale of the physical pixel on the screen. More... | |
virtual int | get_hat (int) const |
Returns the current position of a joystick hat. (Joysticks only) More... | |
virtual std::string | get_key_name (int id) const =0 |
Retrieves the localized friendly key name for specified identifier (i.e. A, B, Leertaste, Backspace, Mouse Left, ...). More... | |
virtual bool | get_keycode (int keycode) const =0 |
Returns true if the passed key code is down for this device. See keys.h for list of key codes. More... | |
virtual std::string | get_name () const =0 |
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D'). More... | |
virtual Pointf | get_position () const |
Returns the current device-independent x and y position (DIP) of the device. (Pointing devices only) The returned positional value is scaled to the pixel ratio of the display. More... | |
virtual InputDevice::Type | get_type () const =0 |
Returns the input device type. More... | |
virtual std::string | keyid_to_string (int) const |
Returns a generic string name for the specified key code. More... | |
virtual void | set_device_position (int x, int y) |
Sets the actual position of the device. (Pointing devices only) More... | |
virtual void | set_position (float x, float y) |
Sets the display-independent position of the device. (Pointing devices only) More... | |
virtual int | string_to_keyid (const std::string &) const |
Returns the key code for the specified generic string key name. More... | |
virtual bool | supports_keyid_mapping () const |
Returns true if this provider implements keyid to/from string mapping. More... | |
![]() | |
DisposableObject () | |
void | dispose () |
bool | is_disposed () const |
void | throw_if_disposed () const |
Additional Inherited Members | |
![]() | |
virtual void | on_dispose ()=0 |
Interface for implementing a InputDevice source.
|
inlinevirtual |
|
inlinevirtual |
Returns the the current position of a joystick axis. (Joysticks only)
|
inlinevirtual |
Returns the number of axes available on this device. (Joysticks only)
|
pure virtual |
Returns the number of buttons available on this device. If used on a keyboard or mouse, this function returns -1.
|
pure virtual |
Return the hardware id/device for this device (i.e. /dev/input/js0)
|
inlinevirtual |
Returns the current device-supplied x and y position of the device. (Pointing devices only) The returned positional value is in the scale of the physical pixel on the screen.
|
inlinevirtual |
Returns the current position of a joystick hat. (Joysticks only)
|
pure virtual |
Retrieves the localized friendly key name for specified identifier (i.e. A, B, Leertaste, Backspace, Mouse Left, ...).
|
pure virtual |
Returns true if the passed key code is down for this device. See keys.h
for list of key codes.
|
pure virtual |
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D').
|
inlinevirtual |
Returns the current device-independent x and y position (DIP) of the device. (Pointing devices only) The returned positional value is scaled to the pixel ratio of the display.
References clan::f.
|
pure virtual |
Returns the input device type.
|
inlinevirtual |
Returns a generic string name for the specified key code.
References clan::string.
|
inlinevirtual |
Sets the actual position of the device. (Pointing devices only)
|
inlinevirtual |
Sets the display-independent position of the device. (Pointing devices only)
|
inlinevirtual |
Returns the key code for the specified generic string key name.
|
inlinevirtual |
Returns true if this provider implements keyid to/from string mapping.