clanDisplay Input

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...
 

Enumerations

enum  clan::InputCode {
  clan::mouse_left =0, clan::mouse_right =1, clan::mouse_middle =2, clan::mouse_wheel_up =3,
  clan::mouse_wheel_down =4, clan::mouse_xbutton1 =5, clan::mouse_xbutton2 =6, clan::mouse_count =7,
  clan::tablet_x_axis = 0x10000, clan::tablet_y_axis, clan::tablet_z_axis, clan::tablet_tilt_x,
  clan::tablet_tilt_y, clan::tablet_rotation_pitch, clan::tablet_rotation_roll, clan::tablet_rotation_yaw,
  clan::tablet_proximity_enter, clan::tablet_proximity_exit, clan::tablet_key, clan::joystick_x = 0,
  clan::joystick_y, clan::joystick_z, clan::joystick_rx, clan::joystick_ry,
  clan::joystick_rz, clan::joystick_slider, clan::joystick_dial, clan::joystick_wheel,
  clan::joystick_vx, clan::joystick_vy, clan::joystick_vz, clan::joystick_vrx,
  clan::joystick_vry, clan::joystick_vrz, clan::joystick_vslider0, clan::joystick_vslider1,
  clan::joystick_ax, clan::joystick_ay, clan::joystick_az, clan::joystick_arx,
  clan::joystick_ary, clan::joystick_arz, clan::joystick_aslider0, clan::joystick_aslider1,
  clan::joystick_fx, clan::joystick_fy, clan::joystick_fz, clan::joystick_frx,
  clan::joystick_fry, clan::joystick_frz, clan::joystick_fslider0, clan::joystick_fslider1,
  clan::joystick_button = 0, clan::joystick_hat = 0, clan::keycode_backspace =XK_BackSpace, clan::keycode_tab =XK_Tab,
  clan::keycode_clear =XK_Clear, clan::keycode_return =XK_Return, clan::keycode_shift =XK_Shift_L, clan::keycode_control =XK_Control_L,
  clan::keycode_menu =XK_Menu, clan::keycode_pause =XK_Pause, clan::keycode_kanji =XK_Kanji, clan::keycode_escape =XK_Escape,
  clan::keycode_convert =XK_Henkan_Mode, clan::keycode_nonconvert =XK_Muhenkan, clan::keycode_space =XK_space, clan::keycode_prior =XK_Prior,
  clan::keycode_next =XK_Next, clan::keycode_end =XK_End, clan::keycode_home =XK_Home, clan::keycode_left =XK_Left,
  clan::keycode_up =XK_Up, clan::keycode_right =XK_Right, clan::keycode_down =XK_Down, clan::keycode_select =XK_Select,
  clan::keycode_print =XK_Print, clan::keycode_execute =XK_Execute, clan::keycode_insert =XK_Insert, clan::keycode_delete =XK_Delete,
  clan::keycode_help =XK_Help, clan::keycode_0 =XK_0, clan::keycode_1 =XK_1, clan::keycode_2 =XK_2,
  clan::keycode_3 =XK_3, clan::keycode_4 =XK_4, clan::keycode_5 =XK_5, clan::keycode_6 =XK_6,
  clan::keycode_7 =XK_7, clan::keycode_8 =XK_8, clan::keycode_9 =XK_9, clan::keycode_a =XK_a,
  clan::keycode_b =XK_b, clan::keycode_c =XK_c, clan::keycode_d =XK_d, clan::keycode_e =XK_e,
  clan::keycode_f =XK_f, clan::keycode_g =XK_g, clan::keycode_h =XK_h, clan::keycode_i =XK_i,
  clan::keycode_j =XK_j, clan::keycode_k =XK_k, clan::keycode_l =XK_l, clan::keycode_m =XK_m,
  clan::keycode_n =XK_n, clan::keycode_o =XK_o, clan::keycode_p =XK_p, clan::keycode_q =XK_q,
  clan::keycode_r =XK_r, clan::keycode_s =XK_s, clan::keycode_t =XK_t, clan::keycode_u =XK_u,
  clan::keycode_v =XK_v, clan::keycode_w =XK_w, clan::keycode_x =XK_x, clan::keycode_y =XK_y,
  clan::keycode_z =XK_z, clan::keycode_lwin =XK_Super_L, clan::keycode_rwin =XK_Multi_key, clan::keycode_apps =XK_Menu,
  clan::keycode_numpad0 =XK_KP_0, clan::keycode_numpad1 =XK_KP_1, clan::keycode_numpad2 =XK_KP_2, clan::keycode_numpad3 =XK_KP_3,
  clan::keycode_numpad4 =XK_KP_4, clan::keycode_numpad5 =XK_KP_5, clan::keycode_numpad6 =XK_KP_6, clan::keycode_numpad7 =XK_KP_7,
  clan::keycode_numpad8 =XK_KP_8, clan::keycode_numpad9 =XK_KP_9, clan::keycode_numpad_enter =XK_KP_Enter, clan::keycode_multiply =XK_KP_Multiply,
  clan::keycode_add =XK_KP_Add, clan::keycode_separator =XK_KP_Separator, clan::keycode_subtract =XK_KP_Subtract, clan::keycode_decimal =XK_KP_Decimal,
  clan::keycode_divide =XK_KP_Divide, clan::keycode_f1 =XK_F1, clan::keycode_f2 =XK_F2, clan::keycode_f3 =XK_F3,
  clan::keycode_f4 =XK_F4, clan::keycode_f5 =XK_F5, clan::keycode_f6 =XK_F6, clan::keycode_f7 =XK_F7,
  clan::keycode_f8 =XK_F8, clan::keycode_f9 =XK_F9, clan::keycode_f10 =XK_F10, clan::keycode_f11 =XK_F11,
  clan::keycode_f12 =XK_F12, clan::keycode_f13 =XK_F13, clan::keycode_f14 =XK_F14, clan::keycode_f15 =XK_F15,
  clan::keycode_f16 =XK_F16, clan::keycode_f17 =XK_F17, clan::keycode_f18 =XK_F18, clan::keycode_f19 =XK_F19,
  clan::keycode_f20 =XK_F20, clan::keycode_f21 =XK_F21, clan::keycode_f22 =XK_F22, clan::keycode_f23 =XK_F23,
  clan::keycode_f24 =XK_F24, clan::keycode_numlock =XK_Num_Lock, clan::keycode_scroll =XK_Scroll_Lock, clan::keycode_lshift =XK_Shift_L,
  clan::keycode_rshift =XK_Shift_R, clan::keycode_lcontrol =XK_Control_L, clan::keycode_rcontrol =XK_Control_R, clan::keycode_lmenu =XK_Meta_L,
  clan::keycode_rmenu =XK_Meta_R, clan::keycode_enter =keycode_return, clan::keycode_lapple =keycode_lwin, clan::keycode_rapple =keycode_rwin,
  clan::keycode_unknown =-1
}
 
enum  clan::InputEvent::Type {
  clan::InputEvent::no_key = 0, clan::InputEvent::pressed = 1, clan::InputEvent::released = 2, clan::InputEvent::doubleclick = 3,
  clan::InputEvent::pointer_moved = 4, clan::InputEvent::axis_moved = 5, clan::InputEvent::proximity_change = 6
}
 Event types. More...
 
enum  clan::InputDevice::Type {
  clan::InputDevice::keyboard, clan::InputDevice::pointer, clan::InputDevice::joystick, clan::InputDevice::tablet,
  clan::InputDevice::unknown
}
 Input device types. 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
 Retrieves the localized friendly key name for specified identifier (i.e. 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. See keys.h for list of key codes. More...
 
virtual Pointf clan::InputDeviceProvider::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 Point clan::InputDeviceProvider::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 float clan::InputDeviceProvider::get_axis (int index) const
 Returns the the current position of a joystick axis. (Joysticks only) More...
 
virtual std::vector< int > clan::InputDeviceProvider::get_axis_ids () const
 Returns the number of axes available on this device. (Joysticks only) More...
 
virtual int clan::InputDeviceProvider::get_hat (int) const
 Returns the current position of a joystick hat. (Joysticks only) More...
 
virtual int clan::InputDeviceProvider::get_button_count () const =0
 Returns the number of buttons available on this device. \warn If used on a keyboard or mouse, this function returns -1. More...
 
virtual bool clan::InputDeviceProvider::in_proximity () const
 Returns true if the input device is in proximity mode. (Tablets only) More...
 

Operations

virtual void clan::InputDeviceProvider::init (Signal< void(const InputEvent &)> *sig_provider_event)=0
 Initialize input device provider. The device field of InputEvent should not be set when emitting events. Invoking sig_provider_event is thread safe. More...
 
virtual void clan::InputDeviceProvider::set_position (float x, float y)
 Sets the display-independent position of the device. (Pointing devices only) More...
 
virtual void clan::InputDeviceProvider::set_device_position (int x, int y)
 Sets the actual position of the device. (Pointing devices only) 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...
 
InputDeviceclan::InputContext::get_keyboard (int keyboard=0)
 Returns the input device for the specified keyboard. More...
 
InputDeviceclan::InputContext::get_mouse (int mouse=0)
 Returns the input device for the specified mouse. More...
 
InputDeviceclan::InputContext::get_joystick (int joystick=0)
 Returns the input device for the specified joystick. More...
 
InputDeviceclan::InputContext::get_tablet (int tablet=0)
 Returns the input device for the specified tablet. More...
 
InputDeviceclan::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...
 
InputDeviceProviderclan::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
 Retrieves the localized friendly key name for specified identifier (i.e. 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. See keys.h for list of key codes. More...
 
Pointf clan::InputDevice::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...
 
Point clan::InputDevice::get_device_position () const
 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...
 
float clan::InputDevice::get_axis (int axisid) const
 Returns the the current position of a joystick axis. (Joysticks only) More...
 
std::vector< int > clan::InputDevice::get_axis_ids () const
 Returns the number of axes available on this device. (Joysticks only) More...
 
int clan::InputDevice::get_hat (int index) const
 Returns the current position of a joystick hat. (Joysticks only) More...
 
int clan::InputDevice::get_button_count () const
 Returns the number of buttons available on this device. \warn If used on a keyboard or mouse, this function returns -1. More...
 
bool clan::InputDevice::in_proximity () const
 Returns true if the input device is in proximity mode. (Tablets only) More...
 

Operations

InputDeviceclan::InputDevice::operator= (const InputDevice &copy)
 
void clan::InputDevice::set_position (float x, float y)
 Sets the display-independent position of the device. (Pointing devices only) More...
 
void clan::InputDevice::set_device_position (int x, int y)
 Sets the actual position of the device. (Pointing devices only) More...
 

Signals

Signal< void(const InputEvent &)> & clan::InputDevice::sig_key_down ()
 Signal emitted when key is pressed. More...
 
Signal< void(const InputEvent &)> & clan::InputDevice::sig_key_up ()
 Signal emitted when key is released. More...
 
Signal< void(const InputEvent &)> & clan::InputDevice::sig_pointer_move ()
 Signal emitted when pointer is moved (absolute movement). More...
 
Signal< void(const InputEvent &)> & clan::InputDevice::sig_axis_move ()
 Signal emitted when axis is moved. More...
 
Signal< void(const InputEvent &)> & clan::InputDevice::sig_key_dblclk ()
 Signal emitted when the mouse is double-clicked. More...
 
Signal< void(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. A key press can generate one, none or multiple characters. The reason for this are deadkeys, i.e. press ^ + a and get ^; 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 (i.e. ^ + 5 => "", "^5") More...
 
Type clan::InputEvent::type
 Event type. More...
 
InputDevice clan::InputEvent::device
 Device that event originates from. More...
 
Pointf clan::InputEvent::mouse_pos
 Mouse position at event time. More...
 
Point clan::InputEvent::mouse_device_pos
 Mouse actual position at event time. More...
 
double clan::InputEvent::axis_pos
 Axis position. More...
 
int clan::InputEvent::repeat_count
 The repeat count for this event. Contains the number of times the keystroke has auto-repeated as a result of the user holding down the key. More...
 
bool clan::InputEvent::alt
 State of modifier keys. More...
 
bool clan::InputEvent::shift
 
bool clan::InputEvent::ctrl
 

Detailed Description

Enumeration Type Documentation

◆ InputCode

Enumerator
mouse_left 
mouse_right 
mouse_middle 
mouse_wheel_up 
mouse_wheel_down 
mouse_xbutton1 
mouse_xbutton2 
mouse_count 
tablet_x_axis 
tablet_y_axis 
tablet_z_axis 
tablet_tilt_x 
tablet_tilt_y 
tablet_rotation_pitch 
tablet_rotation_roll 
tablet_rotation_yaw 
tablet_proximity_enter 
tablet_proximity_exit 
tablet_key 
joystick_x 
joystick_y 
joystick_z 
joystick_rx 
joystick_ry 
joystick_rz 
joystick_slider 
joystick_dial 
joystick_wheel 
joystick_vx 
joystick_vy 
joystick_vz 
joystick_vrx 
joystick_vry 
joystick_vrz 
joystick_vslider0 
joystick_vslider1 
joystick_ax 
joystick_ay 
joystick_az 
joystick_arx 
joystick_ary 
joystick_arz 
joystick_aslider0 
joystick_aslider1 
joystick_fx 
joystick_fy 
joystick_fz 
joystick_frx 
joystick_fry 
joystick_frz 
joystick_fslider0 
joystick_fslider1 
joystick_button 
joystick_hat 
keycode_backspace 
keycode_tab 
keycode_clear 
keycode_return 
keycode_shift 
keycode_control 
keycode_menu 
keycode_pause 
keycode_kanji 
keycode_escape 
keycode_convert 
keycode_nonconvert 
keycode_space 
keycode_prior 
keycode_next 
keycode_end 
keycode_home 
keycode_left 
keycode_up 
keycode_right 
keycode_down 
keycode_select 
keycode_print 
keycode_execute 
keycode_insert 
keycode_delete 
keycode_help 
keycode_0 
keycode_1 
keycode_2 
keycode_3 
keycode_4 
keycode_5 
keycode_6 
keycode_7 
keycode_8 
keycode_9 
keycode_a 
keycode_b 
keycode_c 
keycode_d 
keycode_e 
keycode_f 
keycode_g 
keycode_h 
keycode_i 
keycode_j 
keycode_k 
keycode_l 
keycode_m 
keycode_n 
keycode_o 
keycode_p 
keycode_q 
keycode_r 
keycode_s 
keycode_t 
keycode_u 
keycode_v 
keycode_w 
keycode_x 
keycode_y 
keycode_z 
keycode_lwin 
keycode_rwin 
keycode_apps 
keycode_numpad0 
keycode_numpad1 
keycode_numpad2 
keycode_numpad3 
keycode_numpad4 
keycode_numpad5 
keycode_numpad6 
keycode_numpad7 
keycode_numpad8 
keycode_numpad9 
keycode_numpad_enter 
keycode_multiply 
keycode_add 
keycode_separator 
keycode_subtract 
keycode_decimal 
keycode_divide 
keycode_f1 
keycode_f2 
keycode_f3 
keycode_f4 
keycode_f5 
keycode_f6 
keycode_f7 
keycode_f8 
keycode_f9 
keycode_f10 
keycode_f11 
keycode_f12 
keycode_f13 
keycode_f14 
keycode_f15 
keycode_f16 
keycode_f17 
keycode_f18 
keycode_f19 
keycode_f20 
keycode_f21 
keycode_f22 
keycode_f23 
keycode_f24 
keycode_numlock 
keycode_scroll 
keycode_lshift 
keycode_rshift 
keycode_lcontrol 
keycode_rcontrol 
keycode_lmenu 
keycode_rmenu 
keycode_enter 
keycode_lapple 
keycode_rapple 
keycode_unknown 

◆ Type [1/2]

Event types.

Enumerator
no_key 
pressed 
released 
doubleclick 
pointer_moved 
axis_moved 
proximity_change 

◆ Type [2/2]

Input device types.

Enumerator
keyboard 
pointer 
joystick 
tablet 
unknown 

Function Documentation

◆ InputContext()

clan::InputContext::InputContext ( )

Constructs an input context.

◆ InputDevice() [1/3]

clan::InputDevice::InputDevice ( )

Constructs a null instance.

◆ InputDevice() [2/3]

clan::InputDevice::InputDevice ( InputDeviceProvider provider)

Constructs a InputDevice.

Parameters
provider= Input Device Provider

◆ InputDevice() [3/3]

clan::InputDevice::InputDevice ( std::weak_ptr< InputDevice_Impl >  impl)

Constructs a InputDevice.

Parameters
impl= Weak Ptr

◆ InputEvent()

clan::InputEvent::InputEvent ( )

Constructs a 'NoKey' key.

◆ ~InputContext()

clan::InputContext::~InputContext ( )

◆ ~InputDevice()

clan::InputDevice::~InputDevice ( )

◆ ~InputDeviceProvider()

virtual clan::InputDeviceProvider::~InputDeviceProvider ( )
inlinevirtual

◆ ~InputEvent()

clan::InputEvent::~InputEvent ( )

◆ ~OcclusionQueryProvider()

virtual clan::OcclusionQueryProvider::~OcclusionQueryProvider ( )
inlinevirtual

◆ add_joystick()

void clan::InputContext::add_joystick ( const InputDevice  joystick)

Adds a new joystick to the input context.

◆ add_keyboard()

void clan::InputContext::add_keyboard ( const InputDevice  keyboard)

Adds a new keyboard to the input context.

◆ add_mouse()

void clan::InputContext::add_mouse ( const InputDevice  mouse)

Adds a new mouse to the input context.

◆ add_tablet()

void clan::InputContext::add_tablet ( const InputDevice  tablet)

Adds a new tablet to the input context.

◆ begin()

virtual void clan::OcclusionQueryProvider::begin ( )
pure virtual

Start occlusion query.

◆ clear()

void clan::InputContext::clear ( )

Removes all devices from this input context.

◆ create()

virtual void clan::OcclusionQueryProvider::create ( )
pure virtual

Create occlusion query object.

◆ dispose()

void clan::InputContext::dispose ( )

Stop anyone accessing this input context.

This should is only called internally by the display window destructor

◆ end()

virtual void clan::OcclusionQueryProvider::end ( )
pure virtual

Finish occlusion query.

◆ get_axis() [1/2]

float clan::InputDevice::get_axis ( int  axisid) const

Returns the the current position of a joystick axis. (Joysticks only)

◆ get_axis() [2/2]

virtual float clan::InputDeviceProvider::get_axis ( int  index) const
inlinevirtual

Returns the the current position of a joystick axis. (Joysticks only)

◆ get_axis_ids() [1/2]

virtual std::vector<int> clan::InputDeviceProvider::get_axis_ids ( ) const
inlinevirtual

Returns the number of axes available on this device. (Joysticks only)

◆ get_axis_ids() [2/2]

std::vector<int> clan::InputDevice::get_axis_ids ( ) const

Returns the number of axes available on this device. (Joysticks only)

◆ get_button_count() [1/2]

int clan::InputDevice::get_button_count ( ) const

Returns the number of buttons available on this device. \warn If used on a keyboard or mouse, this function returns -1.

◆ get_button_count() [2/2]

virtual int clan::InputDeviceProvider::get_button_count ( ) const
pure virtual

Returns the number of buttons available on this device. \warn If used on a keyboard or mouse, this function returns -1.

◆ get_device()

InputDevice& clan::InputContext::get_device ( const std::string &  device_name)

Returns the input device with the given devicename.

◆ get_device_name() [1/2]

std::string clan::InputDevice::get_device_name ( ) const

Return the hardware id/device for this device (i.e. /dev/input/js0)

◆ get_device_name() [2/2]

virtual std::string clan::InputDeviceProvider::get_device_name ( ) const
pure virtual

Return the hardware id/device for this device (i.e. /dev/input/js0)

◆ get_device_position() [1/2]

virtual Point clan::InputDeviceProvider::get_device_position ( ) const
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.

◆ get_device_position() [2/2]

Point clan::InputDevice::get_device_position ( ) const

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.

◆ get_hat() [1/2]

int clan::InputDevice::get_hat ( int  index) const

Returns the current position of a joystick hat. (Joysticks only)

Returns
Hat direction in degrees (0-360), or -1 if the hat is centered.

◆ get_hat() [2/2]

virtual int clan::InputDeviceProvider::get_hat ( int  ) const
inlinevirtual

Returns the current position of a joystick hat. (Joysticks only)

Returns
Hat direction in degrees (0-360), or -1 if the hat is centered.

◆ get_joystick()

InputDevice& clan::InputContext::get_joystick ( int  joystick = 0)

Returns the input device for the specified joystick.

◆ get_joystick_count()

int clan::InputContext::get_joystick_count ( ) const

Returns the number of joysticks available.

◆ get_key_name() [1/2]

std::string clan::InputDevice::get_key_name ( int  id) const

Retrieves the localized friendly key name for specified identifier (i.e. A, B, Leertaste, Backspace, Mouse Left, ...).

Note
The returned name for the key may be localized by the system; it

◆ get_key_name() [2/2]

virtual std::string clan::InputDeviceProvider::get_key_name ( int  id) const
pure virtual

Retrieves the localized friendly key name for specified identifier (i.e. A, B, Leertaste, Backspace, Mouse Left, ...).

Note
The returned name for the key may be localized by the system; it

◆ get_keyboard()

InputDevice& clan::InputContext::get_keyboard ( int  keyboard = 0)

Returns the input device for the specified keyboard.

◆ get_keyboard_count()

int clan::InputContext::get_keyboard_count ( ) const

Returns the number of keyboards available.

◆ get_keycode() [1/2]

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.

◆ get_keycode() [2/2]

virtual bool clan::InputDeviceProvider::get_keycode ( int  keycode) const
pure virtual

Returns true if the passed key code is down for this device. See keys.h for list of key codes.

◆ get_mouse()

InputDevice& clan::InputContext::get_mouse ( int  mouse = 0)

Returns the input device for the specified mouse.

◆ get_mouse_count()

int clan::InputContext::get_mouse_count ( ) const

Returns the number of mice available.

◆ get_name() [1/2]

std::string clan::InputDevice::get_name ( ) const

Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D').

◆ get_name() [2/2]

virtual std::string clan::InputDeviceProvider::get_name ( ) const
pure virtual

Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D').

◆ get_position() [1/2]

virtual Pointf clan::InputDeviceProvider::get_position ( ) const
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.

◆ get_position() [2/2]

Pointf clan::InputDevice::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.

◆ get_provider()

InputDeviceProvider* clan::InputDevice::get_provider ( ) const

Returns the provider for this input device.

◆ get_result()

virtual int clan::OcclusionQueryProvider::get_result ( ) const
pure virtual

Returns the result of the occlusion query.

◆ get_tablet()

InputDevice& clan::InputContext::get_tablet ( int  tablet = 0)

Returns the input device for the specified tablet.

◆ get_tablet_count()

int clan::InputContext::get_tablet_count ( ) const

Returns the number of tablets available.

◆ get_type() [1/2]

Type clan::InputDevice::get_type ( ) const

Returns the input device type.

◆ get_type() [2/2]

virtual InputDevice::Type clan::InputDeviceProvider::get_type ( ) const
pure virtual

Returns the input device type.

◆ in_proximity() [1/2]

virtual bool clan::InputDeviceProvider::in_proximity ( ) const
inlinevirtual

Returns true if the input device is in proximity mode. (Tablets only)

◆ in_proximity() [2/2]

bool clan::InputDevice::in_proximity ( ) const

Returns true if the input device is in proximity mode. (Tablets only)

◆ init()

virtual void clan::InputDeviceProvider::init ( Signal< void(const InputEvent &)> *  sig_provider_event)
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.

◆ is_disposed()

bool clan::InputContext::is_disposed ( ) const

Has dispose() been called on this input context.

Returns
true = Has been disposed

◆ is_null()

bool clan::InputDevice::is_null ( ) const
inline

Returns true if this object is invalid.

◆ is_result_ready()

virtual bool clan::OcclusionQueryProvider::is_result_ready ( ) const
pure virtual

Returns true if the GPU is ready to return the result.

◆ keyid_to_string() [1/2]

std::string clan::InputDevice::keyid_to_string ( int  keycode) const

Returns a generic string name for the specified key code.

◆ keyid_to_string() [2/2]

virtual std::string clan::InputDeviceProvider::keyid_to_string ( int  ) const
inlinevirtual

Returns a generic string name for the specified key code.

◆ operator=()

InputDevice& clan::InputDevice::operator= ( const InputDevice copy)

◆ process_messages()

void clan::InputContext::process_messages ( )

Process and dispatch messages to signals.

◆ set_device_position() [1/2]

virtual void clan::InputDeviceProvider::set_device_position ( int  x,
int  y 
)
inlinevirtual

Sets the actual position of the device. (Pointing devices only)

◆ set_device_position() [2/2]

void clan::InputDevice::set_device_position ( int  x,
int  y 
)

Sets the actual position of the device. (Pointing devices only)

◆ set_position() [1/2]

virtual void clan::InputDeviceProvider::set_position ( float  x,
float  y 
)
inlinevirtual

Sets the display-independent position of the device. (Pointing devices only)

◆ set_position() [2/2]

void clan::InputDevice::set_position ( float  x,
float  y 
)

Sets the display-independent position of the device. (Pointing devices only)

◆ sig_axis_move()

Signal<void(const InputEvent &)>& clan::InputDevice::sig_axis_move ( )

Signal emitted when axis is moved.

◆ sig_key_dblclk()

Signal<void(const InputEvent &)>& clan::InputDevice::sig_key_dblclk ( )

Signal emitted when the mouse is double-clicked.

◆ sig_key_down()

Signal<void(const InputEvent &)>& clan::InputDevice::sig_key_down ( )

Signal emitted when key is pressed.

◆ sig_key_up()

Signal<void(const InputEvent &)>& clan::InputDevice::sig_key_up ( )

Signal emitted when key is released.

◆ sig_pointer_move()

Signal<void(const InputEvent &)>& clan::InputDevice::sig_pointer_move ( )

Signal emitted when pointer is moved (absolute movement).

◆ sig_proximity_change()

Signal<void(const InputEvent &)>& clan::InputDevice::sig_proximity_change ( )

Signal emitted when proximity is entered or exited.

◆ string_to_keyid() [1/2]

virtual int clan::InputDeviceProvider::string_to_keyid ( const std::string &  ) const
inlinevirtual

Returns the key code for the specified generic string key name.

◆ string_to_keyid() [2/2]

int clan::InputDevice::string_to_keyid ( const std::string &  str) const

Returns the key code for the specified generic string key name.

◆ supports_keyid_mapping()

virtual bool clan::InputDeviceProvider::supports_keyid_mapping ( ) const
inlinevirtual

Returns true if this provider implements keyid to/from string mapping.

◆ throw_if_null()

void clan::InputDevice::throw_if_null ( ) const

Throw an exception if this object is invalid.

Variable Documentation

◆ alt

bool clan::InputEvent::alt

State of modifier keys.

◆ axis_pos

double clan::InputEvent::axis_pos

Axis position.

◆ ctrl

bool clan::InputEvent::ctrl

◆ device

InputDevice clan::InputEvent::device

Device that event originates from.

◆ id

InputCode clan::InputEvent::id

The exact input.

◆ id_offset

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...)

◆ mouse_device_pos

Point clan::InputEvent::mouse_device_pos

Mouse actual position at event time.

◆ mouse_pos

Pointf clan::InputEvent::mouse_pos

Mouse position at event time.

◆ repeat_count

int clan::InputEvent::repeat_count

The repeat count for this event. Contains the number of times the keystroke has auto-repeated as a result of the user holding down the key.

◆ shift

bool clan::InputEvent::shift

◆ str

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, i.e. press ^ + a and get ^; 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 (i.e. ^ + 5 => "", "^5")

◆ type

Type clan::InputEvent::type

Event type.

Friends

◆ InputContext_Impl

friend class InputContext_Impl
friend