Class GCControllerLiveInput

    • Constructor Detail

      • GCControllerLiveInput

        protected GCControllerLiveInput​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static GCControllerLiveInput allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • capture

        @NotNull
        public @NotNull GCControllerInputState capture()
        Description copied from interface: GCDevicePhysicalInput
        Polls the current state vector of the physical input and saves it to a new instance. If your application is heavily multithreaded this may also be useful to guarantee atomicity of input handling as a snapshot will not change based on further device input once it is taken.
        Specified by:
        capture in interface GCDevicePhysicalInput
        Returns:
        An input state with the duplicated state vector of the current input.
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • inputStateAvailableHandler

        @Nullable
        public GCDevicePhysicalInput.Block_inputStateAvailableHandler_ret inputStateAvailableHandler()
        Description copied from interface: GCDevicePhysicalInput
        Set this block to be notified when a new input state is available. Your handler should repeatedly call \c -nextInputState until it returns \c nil to drain the pending input states from the queue. physicalInput.inputStateQueueDepth = 20; physicalInput.inputStateAvailableHandler = ^(__kindof id physicalInput) { id nextInputState; while ((nextInputState = [physicalInput nextInputState])) { // You can grab the individual states of all elements that your app // is interested in. id buttonA = nextInputState.buttons[GCInputButtonA]; BOOL buttonAPressed = buttonA.pressedInput.pressed; if (buttonAPressed) { // Handle button A pressed } // Your code can first query whether an element's input value changed // from the prior input state. GCDevicePhysicalInputElementChange buttonAChange = [nextInputState changeForElement:buttonA]; if (buttonAChange == GCDevicePhysicalInputElementChanged) { // Handle button A input changed } // Or, your code can request an enumerator of elements with input // values that changed from the prior input state for (id changedElement in nextInputState.changedElements) { } } };
        Specified by:
        inputStateAvailableHandler in interface GCDevicePhysicalInput
      • inputStateQueueDepth

        public long inputStateQueueDepth()
        Description copied from interface: GCDevicePhysicalInput
        The maximum number of input states to buffer. If your application does not drain the pending input states in the queue before this limit is reached, older input states will be discarded - resulting in your application "missing" input state changes. The default value is \c one (no buffering). Smaller values are ignored. A value of \c 20 should be more than enough to ensure no input state changes are missed.
        Specified by:
        inputStateQueueDepth in interface GCDevicePhysicalInput
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • lastEventLatency

        public double lastEventLatency()
        Description copied from interface: GCDevicePhysicalInputState
        The interval (in seconds) between the timestamp of the last event and the current time. This value 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. [@note] If the system has gone to sleep between when the event occurred and when this property is read, the returned value may not reflect the true latency.
        Specified by:
        lastEventLatency in interface GCDevicePhysicalInputState
        Overrides:
        lastEventLatency in class GCControllerInputState
      • lastEventTimestamp

        public double lastEventTimestamp()
        Description copied from interface: GCDevicePhysicalInputState
        The internal time stamp of the last event. This time interval is not relative to any specific point in time. Your application can subtract a previous timestamp from the returned timestamp to determine the time (in seconds) between events. The \c lastEventTimestamp of the inputs from two different devices can be compared to determine which event occurred first.
        Specified by:
        lastEventTimestamp in interface GCDevicePhysicalInputState
        Overrides:
        lastEventTimestamp in class GCControllerInputState
      • queue

        @Nullable
        public @Nullable dispatch_queue_t queue()
        Description copied from interface: GCDevicePhysicalInput
        The dispatch queue that element value change handlers and other callbacks are submitted on. The default queue is the \c handlerQueue of the associated \c device. Set this property if your application wants to receive input callbacks on a different queue. You should set this property before configuring other callbacks. API-Since: 17.0
        Specified by:
        queue in interface GCDevicePhysicalInput
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setInputStateAvailableHandler

        public void setInputStateAvailableHandler​(@Nullable
                                                  GCDevicePhysicalInput.Block_setInputStateAvailableHandler value)
        Description copied from interface: GCDevicePhysicalInput
        Set this block to be notified when a new input state is available. Your handler should repeatedly call \c -nextInputState until it returns \c nil to drain the pending input states from the queue. physicalInput.inputStateQueueDepth = 20; physicalInput.inputStateAvailableHandler = ^(__kindof id physicalInput) { id nextInputState; while ((nextInputState = [physicalInput nextInputState])) { // You can grab the individual states of all elements that your app // is interested in. id buttonA = nextInputState.buttons[GCInputButtonA]; BOOL buttonAPressed = buttonA.pressedInput.pressed; if (buttonAPressed) { // Handle button A pressed } // Your code can first query whether an element's input value changed // from the prior input state. GCDevicePhysicalInputElementChange buttonAChange = [nextInputState changeForElement:buttonA]; if (buttonAChange == GCDevicePhysicalInputElementChanged) { // Handle button A input changed } // Or, your code can request an enumerator of elements with input // values that changed from the prior input state for (id changedElement in nextInputState.changedElements) { } } };
        Specified by:
        setInputStateAvailableHandler in interface GCDevicePhysicalInput
      • setInputStateQueueDepth

        public void setInputStateQueueDepth​(long value)
        Description copied from interface: GCDevicePhysicalInput
        The maximum number of input states to buffer. If your application does not drain the pending input states in the queue before this limit is reached, older input states will be discarded - resulting in your application "missing" input state changes. The default value is \c one (no buffering). Smaller values are ignored. A value of \c 20 should be more than enough to ensure no input state changes are missed.
        Specified by:
        setInputStateQueueDepth in interface GCDevicePhysicalInput
      • setQueue

        public void setQueue​(@Nullable
                             @Nullable dispatch_queue_t value)
        Description copied from interface: GCDevicePhysicalInput
        The dispatch queue that element value change handlers and other callbacks are submitted on. The default queue is the \c handlerQueue of the associated \c device. Set this property if your application wants to receive input callbacks on a different queue. You should set this property before configuring other callbacks. API-Since: 17.0
        Specified by:
        setQueue in interface GCDevicePhysicalInput
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • unmappedInput

        @Nullable
        public @Nullable GCControllerLiveInput unmappedInput()
        Get a view of the controller's input without any system-level control remapping applied. Developers should avoid implementing their own control remapping functionality and to instead direct users to the system game controller settings to remap controls. If you choose to implement your own control remapping functionality, or if your app streams controller input to a remote device that implements control remapping functionality, you should access controller physical input through this interface.
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.
      • version_static

        public static long version_static()