Mir
Functions
miral::toolkit Namespace Reference

Functions

MirEventType mir_event_get_type (MirEvent const *event)
 Retrieves the type of a MirEvent. More...
 
MirInputEvent const * mir_event_get_input_event (MirEvent const *event)
 Retrieve the MirInputEvent associated with a MirEvent of type mir_event_type_input. More...
 
int64_t mir_input_event_get_event_time (MirInputEvent const *event)
 ‍** More...
 
MirInputEventType mir_input_event_get_type (MirInputEvent const *event)
 Retrieve the type of an input event. More...
 
MirKeyboardEvent const * mir_input_event_get_keyboard_event (MirInputEvent const *event)
 Retrieve the MirKeyboardEvent associated with a given input event. More...
 
MirTouchEvent const * mir_input_event_get_touch_event (MirInputEvent const *event)
 Retrieve the MirTouchEvent associated with a given input event. More...
 
MirPointerEvent const * mir_input_event_get_pointer_event (MirInputEvent const *event)
 Retrieve the MirPointerEvent associated with a given input event. More...
 
bool mir_input_event_has_cookie (MirInputEvent const *ev)
 Query if an input event contains a cookie. More...
 
MirEvent const * mir_input_event_get_event (MirInputEvent const *event)
 ‍** More...
 
MirKeyboardAction mir_keyboard_event_action (MirKeyboardEvent const *event)
 Retrieve the action which triggered a given key event. More...
 
xkb_keysym_t mir_keyboard_event_keysym (MirKeyboardEvent const *event)
 Retrieve the xkb mapped keysym associated with the key acted on. More...
 
xkb_keysym_t mir_keyboard_event_key_code (MirKeyboardEvent const *event)
 
int mir_keyboard_event_scan_code (MirKeyboardEvent const *event)
 Retrieve the raw hardware scan code associated with the key acted on. More...
 
char const * mir_keyboard_event_key_text (MirKeyboardEvent const *event)
 Retrieve the text the key press would emit as null terminated utf8 string. More...
 
MirInputEventModifiers mir_keyboard_event_modifiers (MirKeyboardEvent const *event)
 Retrieve the modifier keys pressed when the key action occured. More...
 
MirInputEvent const * mir_keyboard_event_input_event (MirKeyboardEvent const *event)
 Retrieve the corresponding input event. More...
 
MirInputEventModifiers mir_touch_event_modifiers (MirTouchEvent const *event)
 Retrieve the modifier keys pressed when the touch action occured. More...
 
unsigned int mir_touch_event_point_count (MirTouchEvent const *event)
 Retrieve the number of touches reported for a given touch event. More...
 
MirTouchId mir_touch_event_id (MirTouchEvent const *event, unsigned int touch_index)
 Retrieve the TouchID for a touch at given index. More...
 
MirTouchAction mir_touch_event_action (MirTouchEvent const *event, unsigned int touch_index)
 Retrieve the action which occured for a touch at given index. More...
 
MirTouchTooltype mir_touch_event_tooltype (MirTouchEvent const *event, unsigned int touch_index)
 Retrieve the tooltype for touch at given index. More...
 
float mir_touch_event_axis_value (MirTouchEvent const *event, unsigned int touch_index, MirTouchAxis axis)
 Retrieve the axis value for a given axis on an indexed touch. More...
 
MirInputEvent const * mir_touch_event_input_event (MirTouchEvent const *event)
 Retrieve the corresponding input event. More...
 
MirInputEventModifiers mir_pointer_event_modifiers (MirPointerEvent const *event)
 Retrieve the modifier keys pressed when the pointer action occured. More...
 
MirPointerAction mir_pointer_event_action (MirPointerEvent const *event)
 Retrieve the action which occured to generate a given pointer event. More...
 
bool mir_pointer_event_button_state (MirPointerEvent const *event, MirPointerButton button)
 Retrieve the state of a given pointer button when the action occurred. More...
 
MirPointerButtons mir_pointer_event_buttons (MirPointerEvent const *event)
 Retreive the pointer button state as a masked set of values. More...
 
float mir_pointer_event_axis_value (MirPointerEvent const *event, MirPointerAxis axis)
 Retrieve the axis value reported by a given pointer event. More...
 
MirInputEvent const * mir_pointer_event_input_event (MirPointerEvent const *event)
 Retrieve the corresponding input event. More...
 

Function Documentation

◆ mir_event_get_input_event()

MirInputEvent const * miral::toolkit::mir_event_get_input_event ( MirEvent const *  event)

Retrieve the MirInputEvent associated with a MirEvent of type mir_event_type_input.

See <mir_toolkit/events/input/input_event.h> for accessors.

Parameters
[in]eventThe event
Returns
The associated MirInputEvent

◆ mir_event_get_type()

MirEventType miral::toolkit::mir_event_get_type ( MirEvent const *  event)

Retrieves the type of a MirEvent.

Now preferred over direct access to ev->type. In particular ev->type will never be mir_event_type_input and mir_event_get_type is the only way to ensure mir_event_get_input_event will succeed.

Parameters
[in]eventThe event
Returns
The event type

◆ mir_input_event_get_event()

MirEvent const * miral::toolkit::mir_input_event_get_event ( MirInputEvent const *  event)

‍**

Retrieve the MirEvent associated with a given input event.

Parameters
[in]eventThe input event
Returns
The MirEvent

◆ mir_input_event_get_event_time()

int64_t miral::toolkit::mir_input_event_get_event_time ( MirInputEvent const *  event)

‍**

Retrieve the time at which an input event occurred.

Parameters
[in]eventThe input event
Returns
A timestamp in nanoseconds-since-epoch

◆ mir_input_event_get_keyboard_event()

MirKeyboardEvent const * miral::toolkit::mir_input_event_get_keyboard_event ( MirInputEvent const *  event)

Retrieve the MirKeyboardEvent associated with a given input event.

Parameters
[in]eventThe input event
Returns
The MirKeyboardEvent or NULL if event type is not mir_input_event_type_key

◆ mir_input_event_get_pointer_event()

MirPointerEvent const * miral::toolkit::mir_input_event_get_pointer_event ( MirInputEvent const *  event)

Retrieve the MirPointerEvent associated with a given input event.

Parameters
[in]eventThe input event
Returns
The MirPointerEvent or NULL if event type is not mir_input_event_type_pointer

◆ mir_input_event_get_touch_event()

MirTouchEvent const * miral::toolkit::mir_input_event_get_touch_event ( MirInputEvent const *  event)

Retrieve the MirTouchEvent associated with a given input event.

Parameters
[in]eventThe input event
Returns
The MirTouchEvent or NULL if event type is not mir_input_event_type_touch

◆ mir_input_event_get_type()

MirInputEventType miral::toolkit::mir_input_event_get_type ( MirInputEvent const *  event)

Retrieve the type of an input event.

E.g. key, touch...

Parameters
[in]eventThe input event
Returns
The input event type

◆ mir_input_event_has_cookie()

bool miral::toolkit::mir_input_event_has_cookie ( MirInputEvent const *  ev)

Query if an input event contains a cookie.

Parameters
[in]evThe input event
Returns
True if the input event contains a cookie

◆ mir_keyboard_event_action()

MirKeyboardAction miral::toolkit::mir_keyboard_event_action ( MirKeyboardEvent const *  event)

Retrieve the action which triggered a given key event.

Parameters
[in]eventThe key event
Returns
The associated action

◆ mir_keyboard_event_input_event()

MirInputEvent const * miral::toolkit::mir_keyboard_event_input_event ( MirKeyboardEvent const *  event)

Retrieve the corresponding input event.

Parameters
[in]eventThe keyboard event
Returns
The input event

◆ mir_keyboard_event_key_code()

xkb_keysym_t miral::toolkit::mir_keyboard_event_key_code ( MirKeyboardEvent const *  event)
Deprecated:
Returns the same thing as mir_keyboard_event_keysym(), which should be used instead.

◆ mir_keyboard_event_key_text()

char const * miral::toolkit::mir_keyboard_event_key_text ( MirKeyboardEvent const *  event)

Retrieve the text the key press would emit as null terminated utf8 string.

The text will only be available to key down and key repeat events. For mir_keyboard_action_up or key presses that do produce text an empty string will be returned.

Parameters
[in]eventThe key event
Returns
The text

◆ mir_keyboard_event_keysym()

xkb_keysym_t miral::toolkit::mir_keyboard_event_keysym ( MirKeyboardEvent const *  event)

Retrieve the xkb mapped keysym associated with the key acted on.

. May be interpreted as per <xkbcommon/xkbcommon-keysyms.h>

Parameters
[in]eventThe key event
Returns
The xkb_keysym
Remarks
Since MirAL 3.3

◆ mir_keyboard_event_modifiers()

MirInputEventModifiers miral::toolkit::mir_keyboard_event_modifiers ( MirKeyboardEvent const *  event)

Retrieve the modifier keys pressed when the key action occured.

Parameters
[in]eventThe key event
Returns
The modifier mask

◆ mir_keyboard_event_scan_code()

int miral::toolkit::mir_keyboard_event_scan_code ( MirKeyboardEvent const *  event)

Retrieve the raw hardware scan code associated with the key acted on.

May be interpreted as per <linux/input.h>

Parameters
[in]eventThe key event
Returns
The scancode

◆ mir_pointer_event_action()

MirPointerAction miral::toolkit::mir_pointer_event_action ( MirPointerEvent const *  event)

Retrieve the action which occured to generate a given pointer event.

Parameters
[in]eventThe pointer event
Returns
Action performed by the pointer

◆ mir_pointer_event_axis_value()

float miral::toolkit::mir_pointer_event_axis_value ( MirPointerEvent const *  event,
MirPointerAxis  axis 
)

Retrieve the axis value reported by a given pointer event.

Parameters
[in]eventThe pointer event
[in]axisThe axis to retreive a value from
Returns
The value of the given axis

◆ mir_pointer_event_button_state()

bool miral::toolkit::mir_pointer_event_button_state ( MirPointerEvent const *  event,
MirPointerButton  button 
)

Retrieve the state of a given pointer button when the action occurred.

Parameters
[in]eventThe pointer event
[in]buttonThe button to check
Returns
Whether the given button is depressed

◆ mir_pointer_event_buttons()

MirPointerButtons miral::toolkit::mir_pointer_event_buttons ( MirPointerEvent const *  event)

Retreive the pointer button state as a masked set of values.

Parameters
[in]eventThe pointer event
Returns
The button state

◆ mir_pointer_event_input_event()

MirInputEvent const * miral::toolkit::mir_pointer_event_input_event ( MirPointerEvent const *  event)

Retrieve the corresponding input event.

Parameters
[in]eventThe pointer event
Returns
The input event

◆ mir_pointer_event_modifiers()

MirInputEventModifiers miral::toolkit::mir_pointer_event_modifiers ( MirPointerEvent const *  event)

Retrieve the modifier keys pressed when the pointer action occured.

Parameters
[in]eventThe pointer event
Returns
The modifier mask

◆ mir_touch_event_action()

MirTouchAction miral::toolkit::mir_touch_event_action ( MirTouchEvent const *  event,
unsigned int  touch_index 
)

Retrieve the action which occured for a touch at given index.

Parameters
[in]eventThe touch event
[in]touch_indexThe touch index. Must be less than (touch_count - 1).
Returns
Action performed for the touch at index.

◆ mir_touch_event_axis_value()

float miral::toolkit::mir_touch_event_axis_value ( MirTouchEvent const *  event,
unsigned int  touch_index,
MirTouchAxis  axis 
)

Retrieve the axis value for a given axis on an indexed touch.

Parameters
[in]eventThe touch event
[in]touch_indexThe touch index. Must be less than (touch_count - 1).
[in]axisThe axis to retreive a value from
Returns
The value of the given axis

◆ mir_touch_event_id()

MirTouchId miral::toolkit::mir_touch_event_id ( MirTouchEvent const *  event,
unsigned int  touch_index 
)

Retrieve the TouchID for a touch at given index.

Parameters
[in]eventThe touch event
[in]touch_indexThe touch index. Must be less than (touch_count - 1).
Returns
ID of the touch at index

◆ mir_touch_event_input_event()

MirInputEvent const * miral::toolkit::mir_touch_event_input_event ( MirTouchEvent const *  event)

Retrieve the corresponding input event.

Parameters
[in]eventThe touch event
Returns
The input event

◆ mir_touch_event_modifiers()

MirInputEventModifiers miral::toolkit::mir_touch_event_modifiers ( MirTouchEvent const *  event)

Retrieve the modifier keys pressed when the touch action occured.

Parameters
[in]eventThe key event
Returns
The modifier mask

◆ mir_touch_event_point_count()

unsigned int miral::toolkit::mir_touch_event_point_count ( MirTouchEvent const *  event)

Retrieve the number of touches reported for a given touch event.

Each touch is said to be index in the event and may be accessed by index 0, 1, ... , (touch_count - 1)

Parameters
[in]eventThe touch event
Returns
The number of touches

◆ mir_touch_event_tooltype()

MirTouchTooltype miral::toolkit::mir_touch_event_tooltype ( MirTouchEvent const *  event,
unsigned int  touch_index 
)

Retrieve the tooltype for touch at given index.

Parameters
[in]eventThe touch event
[in]touch_indexThe touch index. Must be less than (touch_count - 1).
Returns
Tooltype used for the touch at index

Copyright © 2012-2023 Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.