KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
cont_state_t Struct Reference

Controller state structure. More...

#include <controller.h>

Data Fields

union { 
 
   uint32_t   buttons 
 bit-packed controller button states More...
 
   struct { 
 
      uint32_t   c: 1 
 C button value. More...
 
      uint32_t   b: 1 
 B button value. More...
 
      uint32_t   a: 1 
 A button value. More...
 
      uint32_t   start: 1 
 Start button value. More...
 
      uint32_t   dpad_up: 1 
 Main Dpad Up button value. More...
 
      uint32_t   dpad_down: 1 
 Main Dpad Down button value. More...
 
      uint32_t   dpad_left: 1 
 Main Dpad Left button value. More...
 
      uint32_t   dpad_right: 1 
 Main Dpad Right button value. More...
 
      uint32_t   z: 1 
 Z button value. More...
 
      uint32_t   y: 1 
 Y button value. More...
 
      uint32_t   x: 1 
 X button value. More...
 
      uint32_t   d: 1 
 D button value. More...
 
      uint32_t   dpad2_up: 1 
 Secondary Dpad Up button value. More...
 
      uint32_t   dpad2_down: 1 
 Secondary Dpad Down button value. More...
 
      uint32_t   dpad2_left: 1 
 Secondary Dpad Left button value. More...
 
      uint32_t   dpad2_right: 1 
 Secondary Dpad Right button value. More...
 
      uint32_t   : 16 
 
   }  
 
};  
 
int ltrig
 Left trigger value (0-255).
 
int rtrig
 Right trigger value (0-255).
 
int joyx
 Main joystick x-axis value (-128 - 127).
 
int joyy
 Main joystick y-axis value.
 
int joy2x
 Secondary joystick x-axis value.
 
int joy2y
 Secondary joystick y-axis value.
 

Detailed Description

Controller state structure.

This structure contains information about the status of the controller device and can be fetched by casting the result of maple_dev_status() to this structure.

A 1 bit in the buttons' bitfield indicates that a button is pressed, and the joyx, joyy, joy2x, joy2 values are all 0 based (0 is centered).

Note
Whether a particular field or button is actually used by the controller depends upon its capabilities. See Querying Capabilities.
See also
maple_dev_status

Field Documentation

◆ [union]

union { ... } cont_state_t

◆ __pad0__

uint32_t cont_state_t::__pad0__

◆ a

uint32_t cont_state_t::a

A button value.

◆ b

uint32_t cont_state_t::b

B button value.

◆ buttons

uint32_t cont_state_t::buttons

bit-packed controller button states

See also
controller_buttons

◆ c

uint32_t cont_state_t::c

C button value.

◆ d

uint32_t cont_state_t::d

D button value.

◆ dpad2_down

uint32_t cont_state_t::dpad2_down

Secondary Dpad Down button value.

◆ dpad2_left

uint32_t cont_state_t::dpad2_left

Secondary Dpad Left button value.

◆ dpad2_right

uint32_t cont_state_t::dpad2_right

Secondary Dpad Right button value.

◆ dpad2_up

uint32_t cont_state_t::dpad2_up

Secondary Dpad Up button value.

◆ dpad_down

uint32_t cont_state_t::dpad_down

Main Dpad Down button value.

◆ dpad_left

uint32_t cont_state_t::dpad_left

Main Dpad Left button value.

◆ dpad_right

uint32_t cont_state_t::dpad_right

Main Dpad Right button value.

◆ dpad_up

uint32_t cont_state_t::dpad_up

Main Dpad Up button value.

◆ joy2x

int cont_state_t::joy2x

Secondary joystick x-axis value.

◆ joy2y

int cont_state_t::joy2y

Secondary joystick y-axis value.

◆ joyx

int cont_state_t::joyx

Main joystick x-axis value (-128 - 127).

◆ joyy

int cont_state_t::joyy

Main joystick y-axis value.

◆ ltrig

int cont_state_t::ltrig

Left trigger value (0-255).

◆ rtrig

int cont_state_t::rtrig

Right trigger value (0-255).

◆ start

uint32_t cont_state_t::start

Start button value.

◆ x

uint32_t cont_state_t::x

X button value.

◆ y

uint32_t cont_state_t::y

Y button value.

◆ z

uint32_t cont_state_t::z

Z button value.


The documentation for this struct was generated from the following file: