RetroController Codes: RetroGTK Reference Manual

## RetroController Codes RetroController Codes — Controller input codes and Linux convertion functions |

## Functions

guint16 | retro_joypad_id_to_button_code ()
RetroJoypadId | retro_joypad_id_from_button_code ()

## Types and Values

enum | RetroJoypadId
enum | RetroMouseId
enum | RetroLightgunId
enum | RetroAnalogId
enum | RetroAnalogIndex
enum | RetroPointerId

## Object Hierarchy

        GEnum
        ├── RetroAnalogId
        ├── RetroAnalogIndex
        ├── RetroJoypadId
        ├── RetroLightgunId
        ├── RetroMouseId
        ╰── RetroPointerId

## Includes

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

## Description

## Functions

### retro_joypad_id_to_button_code ()

    guint16
    retro_joypad_id_to_button_code (RetroJoypadId joypad_id);

#### Parameters

joypad_id | a RetroJoypadId |

#### Returns

the corresponding button code

### retro_joypad_id_from_button_code ()

    RetroJoypadId
    retro_joypad_id_from_button_code (guint16 button_code);

#### Parameters

button_code | a button code |

#### Returns

the corresponding joypad id

## Types and Values

### enum RetroJoypadId

Represents the buttons for the Libretro gamepad. The available buttons are the same as the W3C Standard Gamepad, the SDL GameController and many other modern standard gamepads, but the name of the buttons may differ. See the

W3C Gamepad Specification

and the SDL GamepadController definition for more information.

#### Members

RETRO_JOYPAD_ID_B | the bottom action button |
RETRO_JOYPAD_ID_Y | the left action button |
RETRO_JOYPAD_ID_SELECT | the Select button |
RETRO_JOYPAD_ID_START | the Start button |
RETRO_JOYPAD_ID_UP | the up directional button |
RETRO_JOYPAD_ID_DOWN | the down directional button |
RETRO_JOYPAD_ID_LEFT | the left directional button |
RETRO_JOYPAD_ID_RIGHT | the right directional button |
RETRO_JOYPAD_ID_A | the right action button |
RETRO_JOYPAD_ID_X | the top action button |
RETRO_JOYPAD_ID_L | the first left shoulder button |
RETRO_JOYPAD_ID_R | the first right shoulder button |
RETRO_JOYPAD_ID_L2 | the second left shoulder button |
RETRO_JOYPAD_ID_R2 | the second right shoulder button |
RETRO_JOYPAD_ID_L3 | the left thumb button |
RETRO_JOYPAD_ID_R3 | the right thumb button |

### enum RetroMouseId

Represents the inputs for the Libretro mouse.

#### Members

RETRO_MOUSE_ID_X | the X axis of a mouse |
RETRO_MOUSE_ID_Y | the Y axis of a mouse |
RETRO_MOUSE_ID_LEFT | the left button of a mouse |
RETRO_MOUSE_ID_RIGHT | the right button of a mouse |
RETRO_MOUSE_ID_WHEELUP | the up direction of a mouse wheel |
RETRO_MOUSE_ID_WHEELDOWN | the down direction of a mouse wheel |
RETRO_MOUSE_ID_MIDDLE | the middle button of a mouse |
RETRO_MOUSE_ID_HORIZ_WHEELUP | the horizontal up direction of a mouse wheel |
RETRO_MOUSE_ID_HORIZ_WHEELDOWN | the horizontal down direction of a mouse wheel |
RETRO_MOUSE_ID_BUTTON_4 | the fourth button of a mouse |
RETRO_MOUSE_ID_BUTTON_5 | the fifth button of a mouse |

### enum RetroLightgunId

Represents the inputs for the Libretro lightgun.

#### Members

RETRO_LIGHTGUN_ID_X | the X axis of a lightgun |
RETRO_LIGHTGUN_ID_Y | the Y axis of a lightgun |
RETRO_LIGHTGUN_ID_TRIGGER | the trigger of a lightgun |
RETRO_LIGHTGUN_ID_CURSOR | the cursor of a lightgun |
RETRO_LIGHTGUN_ID_TURBO | the turbo button of a lightgun |
RETRO_LIGHTGUN_ID_PAUSE | the pause button of a lightgun |
RETRO_LIGHTGUN_ID_START | the start button of a lightgun |

### enum RetroAnalogId

Represents the axes of the analog sticks for the Libretro gamepad.

#### Members

RETRO_ANALOG_ID_X | the X axis of an analog stick |
RETRO_ANALOG_ID_Y | the Y axis of an analog stick |

### enum RetroAnalogIndex

Represents the analog sticks for the Libretro gamepad.

#### Members

RETRO_ANALOG_INDEX_LEFT | the left analog stick |
RETRO_ANALOG_INDEX_RIGHT | the right analog stick |

### enum RetroPointerId

Represents the inputs for the Libretro pointer.

#### Members

RETRO_POINTER_ID_X | the X axis of a pointer |
RETRO_POINTER_ID_Y | the Y axis of a pointer |
RETRO_POINTER_ID_PRESSED | the pression of a pointer |

## See Also

RetroController