#include <input_device.h>
Public Types | |
enum | Type { keyboard, pointer, joystick, unknown } |
Input device types. More... | |
Public Member Functions | |
virtual float | axis (int axisid) const =0 |
Returns the the current position of a joystick axis. (Joysticks only) More... | |
virtual std::vector< int > | axis_ids () const =0 |
Returns the number of axes available on this device. (Joysticks only) More... | |
virtual int | 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 | device_name () const =0 |
Return the hardware id/device for this device (i.e. /dev/input/js0) More... | |
virtual Point | device_position () const =0 |
Returns the current devicesice-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 | hat (int index) const =0 |
Returns the current position of a joystick hat. (Joysticks only) More... | |
virtual std::string | 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 | 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 | keyid_to_string (int keycode) const =0 |
Returns a generic string name for the specified key code. More... | |
virtual std::string | name () const =0 |
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D'). More... | |
virtual Pointf | position () const =0 |
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 void | set_device_position (int x, int y)=0 |
Sets the actual position of the device. (Pointing devices only) More... | |
virtual void | set_position (float x, float y)=0 |
Sets the display-independent position of the device. (Pointing devices only) More... | |
virtual Signal< void(const InputEvent &)> & | sig_axis_move ()=0 |
Signal emitted when axis is moved. More... | |
virtual Signal< void(const InputEvent &)> & | sig_key_dblclk ()=0 |
Signal emitted when the mouse is double-clicked. More... | |
virtual Signal< void(const InputEvent &)> & | sig_key_down ()=0 |
Signal emitted when key is pressed. More... | |
virtual Signal< void(const InputEvent &)> & | sig_key_up ()=0 |
Signal emitted when key is released. More... | |
virtual Signal< void(const InputEvent &)> & | sig_pointer_move ()=0 |
Signal emitted when pointer is moved (absolute movement). More... | |
virtual Signal< void(const InputEvent &)> & | sig_proximity_change ()=0 |
Signal emitted when proximity is entered or exited. More... | |
virtual int | string_to_keyid (const std::string &str) const =0 |
Returns the key code for the specified generic string key name. More... | |
virtual Type | type () const =0 |
Returns the input device type. More... | |
|
pure virtual |
Returns the the current position of a joystick axis. (Joysticks only)
|
pure virtual |
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)
|
pure virtual |
Returns the current devicesice-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.
|
pure virtual |
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 a generic string name for the specified key code.
|
pure virtual |
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D').
|
pure virtual |
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.
|
pure virtual |
Sets the actual position of the device. (Pointing devices only)
|
pure virtual |
Sets the display-independent position of the device. (Pointing devices only)
|
pure virtual |
Signal emitted when axis is moved.
|
pure virtual |
Signal emitted when the mouse is double-clicked.
|
pure virtual |
Signal emitted when key is pressed.
|
pure virtual |
Signal emitted when key is released.
|
pure virtual |
Signal emitted when pointer is moved (absolute movement).
|
pure virtual |
Signal emitted when proximity is entered or exited.
|
pure virtual |
Returns the key code for the specified generic string key name.
|
pure virtual |
Returns the input device type.