RetroInput: RetroGTK Reference Manual

## RetroInput RetroInput — A structure representing a controller input |

## Functions

RetroInput * | retro_input_new ()
RetroInput * | retro_input_copy ()
void | retro_input_free ()
RetroControllerType | retro_input_get_controller_type ()
gboolean | retro_input_get_joypad ()
gboolean | retro_input_get_mouse ()
gboolean | retro_input_get_lightgun ()
gboolean | retro_input_get_analog ()
gboolean | retro_input_get_pointer ()

## Object Hierarchy

        GBoxed
        ╰── RetroInput

## Includes

    #include <retro-gtk/retro-gtk.h>

## Description

The RetroInput structure represents an input from a controller, like a button, an axis, or a key.

To know the represented input type, first check the input's controller type via `retro_input_get_controller_type()`, then use the accessor function matching it. E.g. if the controller type is `RETRO_CONTROLLER_TYPE_JOYPAD`, you can know which joypad input type is represented via `retro_input_get_joypad()`.

## Functions

### retro_input_new ()

    RetroInput *
    retro_input_new (void);

Creates a new RetroInput.

#### Returns

a new RetroInput, use `retro_input_free()` to free it.

[transfer full]

### retro_input_copy ()

    RetroInput *
    retro_input_copy (RetroInput *self);

Copies `self` into a new RetroInput.

#### Parameters

self | a RetroInput |

#### Returns

a new RetroInput, use `retro_input_free()` to free it.

[transfer full]

### retro_input_free ()

    void
    retro_input_free (RetroInput *self);

Frees the given RetroInput.

#### Parameters

self | a RetroInput |

### retro_input_get_controller_type ()

    RetroControllerType
    retro_input_get_controller_type (RetroInput *self);

Gets the controller type of `self` .

#### Parameters

self | a RetroInput |

#### Returns

the controller type of `self`

### retro_input_get_joypad ()

    gboolean
    retro_input_get_joypad (RetroInput *self,
                            RetroJoypadId *id);

Gets the joypad id of `self` , if any.

#### Parameters

self | a RetroInput |
id | return location for the id. | [out]

#### Returns

whether the id was retrieved

### retro_input_get_mouse ()

    gboolean
    retro_input_get_mouse (RetroInput *self,
                           RetroMouseId *id);

Gets the mouse id of `self` , if any.

#### Parameters

self | a RetroInput |
id | return location for the id. | [out]

#### Returns

whether the id was retrieved

### retro_input_get_lightgun ()

    gboolean
    retro_input_get_lightgun (RetroInput *self,
                              RetroLightgunId *id);

Gets the lightgun id of `self` , if any.

#### Parameters

self | a RetroInput |
id | return location for the id. | [out]

#### Returns

whether the id was retrieved

### retro_input_get_analog ()

    gboolean
    retro_input_get_analog (RetroInput *self,
                            RetroAnalogId *id,
                            RetroAnalogIndex *index);

Gets the analog id and index of `self` , if any.

#### Parameters

self | a RetroInput |
id | return location for the id. | [out]
index | return location for the index. | [out]

#### Returns

whether the id and the index were retrieved

### retro_input_get_pointer ()

    gboolean
    retro_input_get_pointer (RetroInput *self,
                             RetroPointerId *id);

Gets the pointer id of `self` , if any.

#### Parameters

self | a RetroInput |
id | return location for the id. | [out]

#### Returns

whether the id was retrieved

## See Also

RetroController, RetroControllerType