Package apple.gamecontroller.protocol
Interface GCSwitchPositionInput
-
public interface GCSwitchPositionInputAPI-Since: 16.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceGCSwitchPositionInput.Block_positionDidChangeHandler_retstatic interfaceGCSwitchPositionInput.Block_setPositionDidChangeHandler
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanWrap()Check if the position input value can "roll over" when reaching either of its bounds.booleanisSequential()\c YES if the switch input can only transition to positions that are adjacent to the current position.doublelastPositionLatency()The interval (in seconds) between the timestamp of the last event and the current time.doublelastPositionTimestamp()The timestamp of the last value.longposition()The switch's position.@Nullable GCSwitchPositionInput.Block_positionDidChangeHandler_retpositionDidChangeHandler()Set this block if you want to be notified when the value on the switch changes.NSRangepositionRange()The (inclusive) bounds of possible position values for the switch.voidsetPositionDidChangeHandler(@Nullable GCSwitchPositionInput.Block_setPositionDidChangeHandler value)Set this block if you want to be notified when the value on the switch changes.@NotNull NSSet<?>sources()An object describing the physical action(s) the user performs to manipulate this input.
-
-
-
Method Detail
-
canWrap
boolean canWrap()
Check if the position input value can "roll over" when reaching either of its bounds. This will always be \c YES for non-sequential switch inputs.
-
isSequential
boolean isSequential()
\c YES if the switch input can only transition to positions that are adjacent to the current position.
-
lastPositionLatency
double lastPositionLatency()
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.
-
lastPositionTimestamp
double lastPositionTimestamp()
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 returned timestamp to determine the time (in seconds) between changes to the value.
-
position
long position()
The switch's position.- See Also:
valueDidChangeHandler
-
positionDidChangeHandler
@Nullable @Nullable GCSwitchPositionInput.Block_positionDidChangeHandler_ret positionDidChangeHandler()
Set this block if you want to be notified when the value on the switch changes.- Parameters:
input- the element that has been modified.- See Also:
value
-
positionRange
NSRange positionRange()
The (inclusive) bounds of possible position values for the switch.
-
setPositionDidChangeHandler
void setPositionDidChangeHandler(@Nullable @Nullable GCSwitchPositionInput.Block_setPositionDidChangeHandler value)Set this block if you want to be notified when the value on the switch changes.- Parameters:
input- the element that has been modified.- See Also:
value
-
sources
@NotNull @NotNull NSSet<?> sources()
An object describing the physical action(s) the user performs to manipulate this input. API-Since: 17.0
-
-