Package apple.gamecontroller.protocol
Interface GCPressedStateInput
-
public interface GCPressedStateInputAn object conforming to \c GCPressedStateInput represents the pressed state of an element, typically a button. API-Since: 16.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceGCPressedStateInput.Block_pressedDidChangeHandler_retstatic interfaceGCPressedStateInput.Block_setPressedDidChangeHandler
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisPressed()Buttons are mostly used in a digital sense, thus we have a recommended method for checking for pressed state instead of interpreting the value.doublelastPressedStateLatency()The interval (in seconds) between the timestamp of the last pressed state change and the current time.doublelastPressedStateTimestamp()The timestamp of the last pressed state change.@Nullable GCPressedStateInput.Block_pressedDidChangeHandler_retpressedDidChangeHandler()Set this block if you want to be notified when the pressed state changes.voidsetPressedDidChangeHandler(@Nullable GCPressedStateInput.Block_setPressedDidChangeHandler value)Set this block if you want to be notified when the pressed state changes.@NotNull NSSet<?>sources()An object describing the physical action(s) the user performs to manipulate this input.
-
-
-
Method Detail
-
isPressed
boolean isPressed()
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 0. However there may be hysteresis applied to counter noisy input values, thus incidental values around the threshold value may not trigger a change in pressed state. Other buttons may support two-stage actuation, where the button reports a value between 0 and 1 but is only considered pressed when its value is greater than some threshold other than 0.- See Also:
pressedDidChangeHandler()
-
lastPressedStateLatency
double lastPressedStateLatency()
The interval (in seconds) between the timestamp of the last pressed state change 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.
-
lastPressedStateTimestamp
double lastPressedStateTimestamp()
The timestamp of the last pressed state change. 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.
-
pressedDidChangeHandler
@Nullable @Nullable GCPressedStateInput.Block_pressedDidChangeHandler_ret pressedDidChangeHandler()
Set this block if you want to be notified when the pressed state changes.
-
setPressedDidChangeHandler
void setPressedDidChangeHandler(@Nullable @Nullable GCPressedStateInput.Block_setPressedDidChangeHandler value)Set this block if you want to be notified when the pressed state changes.
-
sources
@NotNull @NotNull NSSet<?> sources()
An object describing the physical action(s) the user performs to manipulate this input. API-Since: 17.0
-
-