clan::InputDevice Class Reference

InputDevice. More...

#include <input_device.h>

Public Types

enum  Type {
  keyboard, pointer, joystick, tablet,
  unknown
}
 Input device types. More...
 

Public Member Functions

Construction
 InputDevice ()
 Constructs a null instance. More...
 
 InputDevice (InputDeviceProvider *provider)
 Constructs a InputDevice. More...
 
 InputDevice (std::weak_ptr< InputDevice_Impl > impl)
 Constructs a InputDevice. More...
 
 ~InputDevice ()
 
Attributes
bool is_null () const
 Returns true if this object is invalid. More...
 
void throw_if_null () const
 Throw an exception if this object is invalid. More...
 
InputDeviceProviderget_provider () const
 Returns the provider for this input device. More...
 
std::string get_name () const
 Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D'). More...
 
std::string get_device_name () const
 Return the hardware id/device for this device (i.e. /dev/input/js0) More...
 
Type get_type () const
 Returns the input device type. More...
 
std::string get_key_name (int id) const
 Friendly key name for specified identifier (A, B, Leertaste, Backspace, Mouse Left, ...). More...
 
std::string keyid_to_string (int keycode) const
 Returns a generic string name for the specified key code. More...
 
int string_to_keyid (const std::string &str) const
 Returns the key code for the specified generic string key name. More...
 
bool get_keycode (int keycode) const
 Returns true if the passed key code is down for this device. More...
 
Point get_position () const
 Returns the position (x,y) of the device. More...
 
int get_x () const
 Returns the x position of the device. More...
 
int get_y () const
 Returns the y position of the device. More...
 
float get_axis (int axisid) const
 Returns the the current position of a joystick axis. More...
 
std::vector< int > get_axis_ids () const
 Returns the number of axes available on this device. More...
 
int get_hat (int index) const
 Returns the current position of a joystick hat. More...
 
int get_button_count () const
 Returns the number of buttons available on this device. More...
 
bool in_proximity () const
 Returns true if the input device is in proximity (applicable for tablets). More...
 
Operations
InputDeviceoperator= (const InputDevice &copy)
 
void set_position (int x, int y)
 Sets the position of the device. More...
 
Signals
Signal_v1< const InputEvent & > & sig_key_down ()
 Signal emitted when key is pressed. More...
 
Signal_v1< const InputEvent & > & sig_key_up ()
 Signal emitted when key is released. More...
 
Signal_v1< const InputEvent & > & sig_pointer_move ()
 Signal emitted when pointer is moved (absolute movement). More...
 
Signal_v1< const InputEvent & > & sig_axis_move ()
 Signal emitted when axis is moved. More...
 
Signal_v1< const InputEvent & > & sig_key_dblclk ()
 Signal emitted when the mouse is double-clicked. More...
 
Signal_v1< const InputEvent & > & sig_proximity_change ()
 Signal emitted when proximity is entered or exited. More...
 

Implementation

class InputContext_Impl
 

Detailed Description


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