#include <input_device.h>
Implementation | |
| class | CL_InputContext_Impl |
Public Types | |
| enum | Type { keyboard, pointer, joystick, tablet, unknown } |
| Input device types. More... | |
Public Member Functions | |
Construction | |
| CL_InputDevice () | |
| Constructs an input device. | |
| CL_InputDevice (CL_InputDeviceProvider *provider) | |
| Constructs a InputDevice. | |
| CL_InputDevice (CL_WeakPtr< CL_InputDevice_Impl > impl) | |
| Constructs a InputDevice. | |
| CL_InputDevice (const CL_InputDevice ©) | |
| Constructs a InputDevice. | |
| ~CL_InputDevice () | |
Attributes | |
| CL_InputDeviceProvider * | get_provider () const |
| Returns the provider for this input device. | |
| CL_String | get_name () const |
| Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D'). | |
| CL_String | get_device_name () const |
| Return the hardware id/device for this device (i.e. /dev/input/js0). | |
| Type | get_type () const |
| Returns the input device type. | |
| CL_String | get_key_name (int id) const |
| Friendly key name for specified identifier (A, B, Leertaste, Backspace, Mouse Left, ...). | |
| CL_String | keyid_to_string (int keycode) const |
| Returns a generic string name for the specified key code. | |
| int | string_to_keyid (const CL_String &str) const |
| Returns the key code for the specified generic string key name. | |
| bool | get_keycode (int keycode) const |
| Returns true if the passed key code is down for this device. | |
| CL_Point | get_position () const |
| Returns the position (x,y) of the device. | |
| int | get_x () const |
| Returns the x position of the device. | |
| int | get_y () const |
| Returns the y position of the device. | |
| double | get_axis (int index) const |
| Returns the the current position of a joystick axis. | |
| int | get_axis_count () const |
| Returns the number of axes available on this device. | |
| int | get_button_count () const |
| Returns the number of buttons available on this device. | |
| bool | in_proximity () const |
| Returns true if the input device is in proximity (applicable for tablets). | |
Operations | |
| CL_InputDevice & | operator= (const CL_InputDevice ©) |
| void | set_position (int x, int y) |
| Sets the position of the device. | |
| bool | poll (bool peek_only) |
| Update device. | |
Signals | |
| CL_Signal_v2< const CL_InputEvent &, const CL_InputState & > & | sig_key_down () |
| Signal emitted when key is pressed. | |
| CL_Signal_v2< const CL_InputEvent &, const CL_InputState & > & | sig_key_up () |
| Signal emitted when key is released. | |
| CL_Signal_v2< const CL_InputEvent &, const CL_InputState & > & | sig_pointer_move () |
| Signal emitted when pointer is moved (absolute movement). | |
| CL_Signal_v2< const CL_InputEvent &, const CL_InputState & > & | sig_ball_move () |
| Signal emitted when pointer's ball is moved (relative movement). | |
| CL_Signal_v2< const CL_InputEvent &, const CL_InputState & > & | sig_axis_move () |
| Signal emitted when axis is moved. | |
| CL_Signal_v2< const CL_InputEvent &, const CL_InputState & > & | sig_key_dblclk () |
| Signal emitted when the mouse is double-clicked. | |
| CL_Signal_v2< const CL_InputEvent &, const CL_InputState & > & | sig_proximity_change () |
| Signal emitted when proximity is entered or exited. | |
|
|
Input device types.
|
|
|
Constructs an input device.
|
|
|
Constructs a InputDevice.
|
|
|
Constructs a InputDevice.
|
|
|
Constructs a InputDevice.
|
|
|
|
|
|
Returns the the current position of a joystick axis.
|
|
|
Returns the number of axes available on this device.
|
|
|
Returns the number of buttons available on this device. If used on a keyboard, this function returns -1. |
|
|
Return the hardware id/device for this device (i.e. /dev/input/js0).
|
|
|
Friendly key name for specified identifier (A, B, Leertaste, Backspace, Mouse Left, ...). Note that this key name is localized, meaning it should only be used for menus where the user view key bindings, and not configuration files and such. |
|
|
Returns true if the passed key code is down for this device. See keys.h for list of key codes. |
|
|
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D').
|
|
|
Returns the position (x,y) of the device. Only valid for pointer devices. |
|
|
Returns the provider for this input device.
|
|
|
Returns the input device type.
|
|
|
Returns the x position of the device. Only valid for pointer devices. |
|
|
Returns the y position of the device. Only valid for pointer devices. |
|
|
Returns true if the input device is in proximity (applicable for tablets). Always returns false for non-tablet devices |
|
|
Returns a generic string name for the specified key code.
|
|
|
|
|
|
Update device.
|
|
||||||||||||
|
Sets the position of the device. Only valid for mouse. |
|
|
Signal emitted when axis is moved.
|
|
|
Signal emitted when pointer's ball is moved (relative movement).
|
|
|
Signal emitted when the mouse is double-clicked.
|
|
|
Signal emitted when key is pressed.
|
|
|
Signal emitted when key is released.
|
|
|
Signal emitted when pointer is moved (absolute movement).
|
|
|
Signal emitted when proximity is entered or exited.
|
|
|
Returns the key code for the specified generic string key name.
|
|
|
|
1.4.6