ManetteEvent

ManetteEvent — An event emitted by a device

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── ManetteEvent
    GEnum
    ╰── ManetteEventType

Includes

#include <src/libmanette.h>

Description

Functions

manette_event_copy ()

ManetteEvent *
manette_event_copy (const ManetteEvent *self);

Creates a copy of a ManetteEvent.

[skip]

Parameters

self

a ManetteEvent

 

Returns

a new ManetteEvent.

[transfer full]


manette_event_free ()

void
manette_event_free (ManetteEvent *self);

Frees self .

[skip]

Parameters

self

a ManetteEvent

 

manette_event_get_event_type ()

ManetteEventType
manette_event_get_event_type (const ManetteEvent *self);

Gets the event type of self .

Parameters

self

a ManetteEvent

 

Returns

the event type of self


manette_event_get_time ()

guint32
manette_event_get_time (const ManetteEvent *self);

Gets the timestamp of when self was received by the input driver that takes care of its device. Use this timestamp to ensure external factors such as synchronous disk writes don't influence your timing computations.

Parameters

self

a ManetteEvent

 

Returns

the timestamp of when self was received by the input driver


manette_event_get_device ()

ManetteDevice *
manette_event_get_device (const ManetteEvent *self);

Gets the ManetteDevice associated with the self .

Parameters

self

a ManetteEvent

 

Returns

the ManetteDevice associated with the self .

[transfer none]


manette_event_get_hardware_type ()

guint16
manette_event_get_hardware_type (const ManetteEvent *self);

Gets the hardware type of self .

Parameters

self

a ManetteEvent

 

Returns

the hardware type of self


manette_event_get_hardware_code ()

guint16
manette_event_get_hardware_code (const ManetteEvent *self);

Gets the hardware code of self .

Parameters

self

a ManetteEvent

 

Returns

the hardware code of self


manette_event_get_hardware_value ()

guint16
manette_event_get_hardware_value (const ManetteEvent *self);

Gets the hardware value of self .

Parameters

self

a ManetteEvent

 

Returns

the hardware value of self


manette_event_get_hardware_index ()

guint16
manette_event_get_hardware_index (const ManetteEvent *self);

Gets the hardware index of self .

Parameters

self

a ManetteEvent

 

Returns

the hardware index of self


manette_event_get_button ()

gboolean
manette_event_get_button (const ManetteEvent *self,
                          guint16 *button);

Gets the button of self , if any.

Parameters

self

a ManetteEvent

 

button

return location for the button.

[out]

Returns

whether the button was retrieved


manette_event_get_absolute ()

gboolean
manette_event_get_absolute (const ManetteEvent *self,
                            guint16 *axis,
                            gdouble *value);

Gets the axis of self , if any.

Parameters

self

a ManetteEvent

 

axis

return location for the axis.

[out]

value

return location for the axis.

[out]

Returns

whether the axis was retrieved


manette_event_get_hat ()

gboolean
manette_event_get_hat (const ManetteEvent *self,
                       guint16 *axis,
                       gint8 *value);

Gets the hat of self , if any.

Parameters

self

a ManetteEvent

 

axis

return location for the hat.

[out]

value

return location for the hat.

[out]

Returns

whether the hat was retrieved

Types and Values

enum ManetteEventType

Specifies the type of the event.

Members

MANETTE_EVENT_NOTHING

a special code to indicate a null event

 

MANETTE_EVENT_BUTTON_PRESS

a button has been pressed

 

MANETTE_EVENT_BUTTON_RELEASE

a button has been released

 

MANETTE_EVENT_ABSOLUTE

an absolute axis has been moved

 

MANETTE_EVENT_HAT

a hat axis has been moved

 

MANETTE_LAST_EVENT

the number of event types

 

See Also

ManetteDevice