Classes | |
class | clan::InputContext |
InputContext. More... | |
class | clan::InputDevice |
InputDevice. More... | |
class | clan::InputDeviceProvider |
Interface for implementing a InputDevice source. More... | |
class | clan::InputEvent |
Input event class. More... | |
class | clan::OcclusionQueryProvider |
Occlusion query provider. More... | |
Construction | |
virtual | clan::InputDeviceProvider::~InputDeviceProvider () |
Attributes | |
virtual std::string | clan::InputDeviceProvider::get_name () const =0 |
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D'). More... | |
virtual std::string | clan::InputDeviceProvider::get_device_name () const =0 |
Return the hardware id/device for this device (i.e. /dev/input/js0) More... | |
virtual InputDevice::Type | clan::InputDeviceProvider::get_type () const =0 |
Returns the input device type. More... | |
virtual std::string | clan::InputDeviceProvider::get_key_name (int id) const =0 |
Friendly key name for specified identifier (A, B, Leertaste, Backspace, Mouse Left, ...). More... | |
virtual bool | clan::InputDeviceProvider::supports_keyid_mapping () const |
Returns true if this provider implements keyid to/from string mapping. More... | |
virtual std::string | clan::InputDeviceProvider::keyid_to_string (int) const |
Returns a generic string name for the specified key code. More... | |
virtual int | clan::InputDeviceProvider::string_to_keyid (const std::string &) const |
Returns the key code for the specified generic string key name. More... | |
virtual bool | clan::InputDeviceProvider::get_keycode (int keycode) const =0 |
Returns true if the passed key code is down for this device. More... | |
virtual int | clan::InputDeviceProvider::get_x () const =0 |
Returns the x position of the device. More... | |
virtual int | clan::InputDeviceProvider::get_y () const =0 |
Returns the y position of the device. More... | |
virtual float | clan::InputDeviceProvider::get_axis (int index) const =0 |
Returns the the current position of a joystick axis. More... | |
virtual std::vector< int > | clan::InputDeviceProvider::get_axis_ids () const =0 |
Returns the number of axes available on this device. More... | |
virtual int | clan::InputDeviceProvider::get_hat (int) const |
Returns the current position of a joystick hat. More... | |
virtual int | clan::InputDeviceProvider::get_button_count () const =0 |
Returns the number of buttons available on this device. More... | |
virtual bool | clan::InputDeviceProvider::in_proximity () const =0 |
Returns the input device is in proximity mode. (Atm applicapble only to tablet.) More... | |
Operations | |
virtual void | clan::InputDeviceProvider::init (Signal_v1< const InputEvent & > *sig_provider_event)=0 |
Initialize input device provider. More... | |
virtual void | clan::InputDeviceProvider::set_position (int x, int y)=0 |
Sets the position of the device. More... | |
Construction | |
virtual | clan::OcclusionQueryProvider::~OcclusionQueryProvider () |
Attributes | |
virtual bool | clan::OcclusionQueryProvider::is_result_ready () const =0 |
Returns true if the GPU is ready to return the result. More... | |
virtual int | clan::OcclusionQueryProvider::get_result () const =0 |
Returns the result of the occlusion query. More... | |
Operations | |
virtual void | clan::OcclusionQueryProvider::begin ()=0 |
Start occlusion query. More... | |
virtual void | clan::OcclusionQueryProvider::end ()=0 |
Finish occlusion query. More... | |
virtual void | clan::OcclusionQueryProvider::create ()=0 |
Create occlusion query object. More... | |
Construction | |
clan::InputContext::InputContext () | |
Constructs an input context. More... | |
clan::InputContext::~InputContext () | |
Attributes | |
int | clan::InputContext::get_keyboard_count () const |
Returns the number of keyboards available. More... | |
int | clan::InputContext::get_mouse_count () const |
Returns the number of mice available. More... | |
int | clan::InputContext::get_joystick_count () const |
Returns the number of joysticks available. More... | |
int | clan::InputContext::get_tablet_count () const |
Returns the number of tablets available. More... | |
InputDevice & | clan::InputContext::get_keyboard (int keyboard=0) |
Returns the input device for the specified keyboard. More... | |
InputDevice & | clan::InputContext::get_mouse (int mouse=0) |
Returns the input device for the specified mouse. More... | |
InputDevice & | clan::InputContext::get_joystick (int joystick=0) |
Returns the input device for the specified joystick. More... | |
InputDevice & | clan::InputContext::get_tablet (int tablet=0) |
Returns the input device for the specified tablet. More... | |
InputDevice & | clan::InputContext::get_device (const std::string &device_name) |
Returns the input device with the given devicename. More... | |
Operations | |
void | clan::InputContext::clear () |
Removes all devices from this input context. More... | |
void | clan::InputContext::add_keyboard (const InputDevice keyboard) |
Adds a new keyboard to the input context. More... | |
void | clan::InputContext::add_mouse (const InputDevice mouse) |
Adds a new mouse to the input context. More... | |
void | clan::InputContext::add_joystick (const InputDevice joystick) |
Adds a new joystick to the input context. More... | |
void | clan::InputContext::add_tablet (const InputDevice tablet) |
Adds a new tablet to the input context. More... | |
void | clan::InputContext::process_messages () |
Process and dispatch messages to signals. More... | |
void | clan::InputContext::dispose () |
Stop anyone accessing this input context. More... | |
bool | clan::InputContext::is_disposed () const |
Has dispose() been called on this input context. More... | |
Construction | |
clan::InputDevice::InputDevice () | |
Constructs a null instance. More... | |
clan::InputDevice::InputDevice (InputDeviceProvider *provider) | |
Constructs a InputDevice. More... | |
clan::InputDevice::InputDevice (std::weak_ptr< InputDevice_Impl > impl) | |
Constructs a InputDevice. More... | |
clan::InputDevice::~InputDevice () | |
Attributes | |
bool | clan::InputDevice::is_null () const |
Returns true if this object is invalid. More... | |
void | clan::InputDevice::throw_if_null () const |
Throw an exception if this object is invalid. More... | |
InputDeviceProvider * | clan::InputDevice::get_provider () const |
Returns the provider for this input device. More... | |
std::string | clan::InputDevice::get_name () const |
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D'). More... | |
std::string | clan::InputDevice::get_device_name () const |
Return the hardware id/device for this device (i.e. /dev/input/js0) More... | |
Type | clan::InputDevice::get_type () const |
Returns the input device type. More... | |
std::string | clan::InputDevice::get_key_name (int id) const |
Friendly key name for specified identifier (A, B, Leertaste, Backspace, Mouse Left, ...). More... | |
std::string | clan::InputDevice::keyid_to_string (int keycode) const |
Returns a generic string name for the specified key code. More... | |
int | clan::InputDevice::string_to_keyid (const std::string &str) const |
Returns the key code for the specified generic string key name. More... | |
bool | clan::InputDevice::get_keycode (int keycode) const |
Returns true if the passed key code is down for this device. More... | |
Point | clan::InputDevice::get_position () const |
Returns the position (x,y) of the device. More... | |
int | clan::InputDevice::get_x () const |
Returns the x position of the device. More... | |
int | clan::InputDevice::get_y () const |
Returns the y position of the device. More... | |
float | clan::InputDevice::get_axis (int axisid) const |
Returns the the current position of a joystick axis. More... | |
std::vector< int > | clan::InputDevice::get_axis_ids () const |
Returns the number of axes available on this device. More... | |
int | clan::InputDevice::get_hat (int index) const |
Returns the current position of a joystick hat. More... | |
int | clan::InputDevice::get_button_count () const |
Returns the number of buttons available on this device. More... | |
bool | clan::InputDevice::in_proximity () const |
Returns true if the input device is in proximity (applicable for tablets). More... | |
Operations | |
InputDevice & | clan::InputDevice::operator= (const InputDevice ©) |
void | clan::InputDevice::set_position (int x, int y) |
Sets the position of the device. More... | |
Signals | |
Signal_v1< const InputEvent & > & | clan::InputDevice::sig_key_down () |
Signal emitted when key is pressed. More... | |
Signal_v1< const InputEvent & > & | clan::InputDevice::sig_key_up () |
Signal emitted when key is released. More... | |
Signal_v1< const InputEvent & > & | clan::InputDevice::sig_pointer_move () |
Signal emitted when pointer is moved (absolute movement). More... | |
Signal_v1< const InputEvent & > & | clan::InputDevice::sig_axis_move () |
Signal emitted when axis is moved. More... | |
Signal_v1< const InputEvent & > & | clan::InputDevice::sig_key_dblclk () |
Signal emitted when the mouse is double-clicked. More... | |
Signal_v1< const InputEvent & > & | clan::InputDevice::sig_proximity_change () |
Signal emitted when proximity is entered or exited. More... | |
Implementation | |
class | clan::InputDevice::InputContext_Impl |
Construction | |
clan::InputEvent::InputEvent () | |
Constructs a 'NoKey' key. More... | |
clan::InputEvent::~InputEvent () | |
Operations | |
InputCode | clan::InputEvent::id |
The exact input. More... | |
int | clan::InputEvent::id_offset |
Contains the value (0 to x) for certains InputCode types that have a variable output identifier (for example, joystick button identifers, or joystick axis...) More... | |
std::string | clan::InputEvent::str |
Character sequence generated by event. More... | |
Type | clan::InputEvent::type |
Event type. More... | |
InputDevice | clan::InputEvent::device |
Device that event originates from. More... | |
Point | clan::InputEvent::mouse_pos |
Mouse position at event time. More... | |
double | clan::InputEvent::axis_pos |
Axis position. More... | |
int | clan::InputEvent::repeat_count |
The repeat count for this event. More... | |
bool | clan::InputEvent::alt |
State of modifier keys. More... | |
bool | clan::InputEvent::shift |
bool | clan::InputEvent::ctrl |
enum clan::InputCode |
Event types.
Enumerator | |
---|---|
no_key | |
pressed | |
released | |
doubleclick | |
pointer_moved | |
axis_moved | |
proximity_change |
clan::InputContext::InputContext | ( | ) |
Constructs an input context.
clan::InputDevice::InputDevice | ( | ) |
Constructs a null instance.
clan::InputDevice::InputDevice | ( | InputDeviceProvider * | provider | ) |
Constructs a InputDevice.
provider | = Input Device Provider |
clan::InputDevice::InputDevice | ( | std::weak_ptr< InputDevice_Impl > | impl | ) |
Constructs a InputDevice.
impl | = Weak Ptr |
clan::InputEvent::InputEvent | ( | ) |
Constructs a 'NoKey' key.
clan::InputContext::~InputContext | ( | ) |
clan::InputDevice::~InputDevice | ( | ) |
|
inlinevirtual |
clan::InputEvent::~InputEvent | ( | ) |
|
inlinevirtual |
void clan::InputContext::add_joystick | ( | const InputDevice | joystick | ) |
Adds a new joystick to the input context.
void clan::InputContext::add_keyboard | ( | const InputDevice | keyboard | ) |
Adds a new keyboard to the input context.
void clan::InputContext::add_mouse | ( | const InputDevice | mouse | ) |
Adds a new mouse to the input context.
void clan::InputContext::add_tablet | ( | const InputDevice | tablet | ) |
Adds a new tablet to the input context.
|
pure virtual |
Start occlusion query.
void clan::InputContext::clear | ( | ) |
Removes all devices from this input context.
|
pure virtual |
Create occlusion query object.
void clan::InputContext::dispose | ( | ) |
Stop anyone accessing this input context.
This should is only called internally by the display window destructor
|
pure virtual |
Finish occlusion query.
|
pure virtual |
Returns the the current position of a joystick axis.
float clan::InputDevice::get_axis | ( | int | axisid | ) | const |
Returns the the current position of a joystick axis.
|
pure virtual |
Returns the number of axes available on this device.
std::vector<int> clan::InputDevice::get_axis_ids | ( | ) | const |
Returns the number of axes available on this device.
|
pure virtual |
Returns the number of buttons available on this device.
If used on a keyboard, this function returns -1.
int clan::InputDevice::get_button_count | ( | ) | const |
Returns the number of buttons available on this device.
If used on a keyboard, this function returns -1.
InputDevice& clan::InputContext::get_device | ( | const std::string & | device_name | ) |
Returns the input device with the given devicename.
|
pure virtual |
Return the hardware id/device for this device (i.e. /dev/input/js0)
std::string clan::InputDevice::get_device_name | ( | ) | const |
Return the hardware id/device for this device (i.e. /dev/input/js0)
|
inlinevirtual |
Returns the current position of a joystick hat.
int clan::InputDevice::get_hat | ( | int | index | ) | const |
Returns the current position of a joystick hat.
InputDevice& clan::InputContext::get_joystick | ( | int | joystick = 0 | ) |
Returns the input device for the specified joystick.
int clan::InputContext::get_joystick_count | ( | ) | const |
Returns the number of joysticks available.
|
pure virtual |
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.
std::string clan::InputDevice::get_key_name | ( | int | id | ) | const |
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.
InputDevice& clan::InputContext::get_keyboard | ( | int | keyboard = 0 | ) |
Returns the input device for the specified keyboard.
int clan::InputContext::get_keyboard_count | ( | ) | const |
Returns the number of keyboards available.
|
pure virtual |
Returns true if the passed key code is down for this device.
See keys.h for list of key codes.
bool clan::InputDevice::get_keycode | ( | int | keycode | ) | const |
Returns true if the passed key code is down for this device.
See keys.h for list of key codes.
InputDevice& clan::InputContext::get_mouse | ( | int | mouse = 0 | ) |
Returns the input device for the specified mouse.
int clan::InputContext::get_mouse_count | ( | ) | const |
Returns the number of mice available.
|
pure virtual |
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D').
std::string clan::InputDevice::get_name | ( | ) | const |
Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D').
Point clan::InputDevice::get_position | ( | ) | const |
Returns the position (x,y) of the device.
Only valid for pointer devices.
InputDeviceProvider* clan::InputDevice::get_provider | ( | ) | const |
Returns the provider for this input device.
|
pure virtual |
Returns the result of the occlusion query.
InputDevice& clan::InputContext::get_tablet | ( | int | tablet = 0 | ) |
Returns the input device for the specified tablet.
int clan::InputContext::get_tablet_count | ( | ) | const |
Returns the number of tablets available.
|
pure virtual |
Returns the input device type.
Type clan::InputDevice::get_type | ( | ) | const |
Returns the input device type.
|
pure virtual |
Returns the x position of the device.
Only valid for mouse.
int clan::InputDevice::get_x | ( | ) | const |
Returns the x position of the device.
Only valid for pointer devices.
|
pure virtual |
Returns the y position of the device.
Only valid for mouse.
int clan::InputDevice::get_y | ( | ) | const |
Returns the y position of the device.
Only valid for pointer devices.
|
pure virtual |
Returns the input device is in proximity mode. (Atm applicapble only to tablet.)
If used on other devices than tablet, returns false.
bool clan::InputDevice::in_proximity | ( | ) | const |
Returns true if the input device is in proximity (applicable for tablets).
Always returns false for non-tablet devices
|
pure virtual |
Initialize input device provider.
The device field of InputEvent should not be set when emitting events.
Invoking sig_provider_event is thread safe.
bool clan::InputContext::is_disposed | ( | ) | const |
Has dispose() been called on this input context.
|
inline |
Returns true if this object is invalid.
|
pure virtual |
Returns true if the GPU is ready to return the result.
|
inlinevirtual |
Returns a generic string name for the specified key code.
std::string clan::InputDevice::keyid_to_string | ( | int | keycode | ) | const |
Returns a generic string name for the specified key code.
InputDevice& clan::InputDevice::operator= | ( | const InputDevice & | copy | ) |
void clan::InputContext::process_messages | ( | ) |
Process and dispatch messages to signals.
|
pure virtual |
Sets the position of the device.
void clan::InputDevice::set_position | ( | int | x, |
int | y | ||
) |
Sets the position of the device.
Only valid for mouse.
Signal_v1<const InputEvent &>& clan::InputDevice::sig_axis_move | ( | ) |
Signal emitted when axis is moved.
Signal_v1<const InputEvent &>& clan::InputDevice::sig_key_dblclk | ( | ) |
Signal emitted when the mouse is double-clicked.
Signal_v1<const InputEvent &>& clan::InputDevice::sig_key_down | ( | ) |
Signal emitted when key is pressed.
Signal_v1<const InputEvent &>& clan::InputDevice::sig_key_up | ( | ) |
Signal emitted when key is released.
Signal_v1<const InputEvent &>& clan::InputDevice::sig_pointer_move | ( | ) |
Signal emitted when pointer is moved (absolute movement).
Signal_v1<const InputEvent &>& clan::InputDevice::sig_proximity_change | ( | ) |
Signal emitted when proximity is entered or exited.
|
inlinevirtual |
Returns the key code for the specified generic string key name.
int clan::InputDevice::string_to_keyid | ( | const std::string & | str | ) | const |
Returns the key code for the specified generic string key name.
|
inlinevirtual |
Returns true if this provider implements keyid to/from string mapping.
void clan::InputDevice::throw_if_null | ( | ) | const |
Throw an exception if this object is invalid.
bool clan::InputEvent::alt |
State of modifier keys.
double clan::InputEvent::axis_pos |
Axis position.
bool clan::InputEvent::ctrl |
InputDevice clan::InputEvent::device |
Device that event originates from.
InputCode clan::InputEvent::id |
The exact input.
int clan::InputEvent::id_offset |
Contains the value (0 to x) for certains InputCode types that have a variable output identifier (for example, joystick button identifers, or joystick axis...)
Point clan::InputEvent::mouse_pos |
Mouse position at event time.
int clan::InputEvent::repeat_count |
The repeat count for this event.
The variable contains the number of times the keystroke is autorepeated as a result of the user holding down the key.
bool clan::InputEvent::shift |
std::string clan::InputEvent::str |
Character sequence generated by event.
A key press can generate one, none or multiple characters, the reason for this are deadkeys, ie. press ^ + a and get ^, so the first press would generate no key and the second one, in case that the second key being pressed doesn't support the ^ it would generate two characters (ie. ^ + 5 => "", "^5")
Type clan::InputEvent::type |
Event type.
|
friend |