RetroArch
Protected Types | Properties | List of all members
GCControllerButtonInput Class Reference

#import <GCControllerButtonInput.h>

Inheritance diagram for GCControllerButtonInput:
[legend]
Collaboration diagram for GCControllerButtonInput:
[legend]

Protected Types

typedef void(^ GCControllerButtonValueChangedHandler) (GCControllerButtonInput *button, float value, BOOL pressed)
 

Properties

GCControllerButtonValueChangedHandler valueChangedHandler
 
float value
 
BOOL pressed
 
- Properties inherited from GCControllerElement
GCControllerElementcollection
 
BOOL analog
 

Member Typedef Documentation

◆ GCControllerButtonValueChangedHandler

- (typedef void(^ GCControllerButtonValueChangedHandler) (GCControllerButtonInput *button, float value, BOOL pressed))
protected

Set this block if you want to be notified when the value on this button changes.

Parameters
buttonthe element that has been modified.
valuethe value the button was set to at the time the valueChangedHandler fired.
pressedthe pressed state of the button at the time the valueChangedHandler fired.

Property Documentation

◆ pressed

- (BOOL) pressed
readatomicassign

Buttons are mostly used in a digital sense, thus we have a recommended method for checking for pressed state instead of interpreting the value.

As a general guideline a button is pressed if the value exceeds 25%. However there may be hysterisis applied to counter noisy input values, thus incidental values around the threshold value may not trigger a change in pressed state.

◆ value

- (float) value
readatomicassign

A normalized value for the input. Between 0 and 1 for button inputs. Values are saturated and thus never exceed the range of [0, 1].

◆ valueChangedHandler

- (GCControllerButtonValueChangedHandler) valueChangedHandler
readwriteatomiccopy

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