Package apple.gamecontroller.protocol
Interface GCAxisInput
-
public interface GCAxisInputAn object conforming to \c GCAxisInput represents an input that produces normalized values - between [-1, 1] - along an axis with a fixed origin. The origin - a value of 0 - corresponds the neutral state of the input. API-Since: 16.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceGCAxisInput.Block_setValueDidChangeHandlerstatic interfaceGCAxisInput.Block_valueDidChangeHandler_ret
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanWrap()Check if the axis input value "rolls over" when reaching either the extreme high or low value.booleanisAnalog()Check if the axis can support more than just digital values.doublelastValueLatency()The interval (in seconds) between the timestamp of the last event and the current time.doublelastValueTimestamp()The timestamp of the last value.voidsetValueDidChangeHandler(@Nullable GCAxisInput.Block_setValueDidChangeHandler value)Set this block to be notified when the value of the axis input changes.@NotNull NSSet<?>sources()An object describing the physical action(s) the user performs to manipulate this input.floatvalue()A normalized value for the axis input, between -1 and 1 (inclusive).@Nullable GCAxisInput.Block_valueDidChangeHandler_retvalueDidChangeHandler()Set this block to be notified when the value of the axis input changes.
-
-
-
Method Detail
-
canWrap
boolean canWrap()
Check if the axis input value "rolls over" when reaching either the extreme high or low value. For example, some dials can be rotated past the position that represents their maximum value causing the reported value to roll over. Defaults to \c NO for most axis elements.
-
isAnalog
boolean isAnalog()
Check if the axis can support more than just digital values. Defaults to \c YES for most axis inputs.
-
lastValueLatency
double lastValueLatency()
The interval (in seconds) between the timestamp of the last event and the current time. This should be treated as a lower bound of the event latency. It may not include (wired or wireless) transmission latency, or latency accrued on the device before the event was transmitted to the host.
-
lastValueTimestamp
double lastValueTimestamp()
The timestamp of the last value. This time interval is not relative to any specific point in time. You can subtract a previous timestamp from the current timestamp to determine the time (in seconds) between changes to the value.
-
setValueDidChangeHandler
void setValueDidChangeHandler(@Nullable @Nullable GCAxisInput.Block_setValueDidChangeHandler value)Set this block to be notified when the value of the axis input changes.- Parameters:
element- the element that has been modified.input- the input that has been modified.value- the value the axis was set to at the time the valueChangedHandler fired.
-
value
float value()
A normalized value for the axis input, between -1 and 1 (inclusive). The values are deadzoned and saturated before they are returned so there is no value outside the range. Deadzoning does not remove values from the range, the full 0 to 1 magnitude of values are possible from the input. As an axis is often used in a digital sense, you can rely on a value of 0 meaning the axis is inside the deadzone. Any value greater than or less than zero is not in the deadzone.
-
valueDidChangeHandler
@Nullable @Nullable GCAxisInput.Block_valueDidChangeHandler_ret valueDidChangeHandler()
Set this block to be notified when the value of the axis input changes.- Parameters:
element- the element that has been modified.input- the input that has been modified.value- the value the axis was set to at the time the valueChangedHandler fired.
-
sources
@NotNull @NotNull NSSet<?> sources()
An object describing the physical action(s) the user performs to manipulate this input. API-Since: 17.0
-
-