Class GCPhysicalInputProfile

  • All Implemented Interfaces:
    NSObject
    Direct Known Subclasses:
    GCExtendedGamepad, GCGamepad, GCKeyboardInput, GCMicroGamepad, GCMouseInput

    public class GCPhysicalInputProfile
    extends NSObject
    A game controller profile representing physical buttons, thumbsticks, dpads, etc... on a controller. All controller profiles provide a base level of information about the controller they belong to. A profile maps the hardware notion of a controller into a logical controller. One that a developer can design for and depend on, no matter the underlying hardware. API-Since: 14.0
    • Constructor Detail

      • GCPhysicalInputProfile

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allElements

        @NotNull
        public @NotNull NSSet<? extends GCControllerElement> allElements()
        The following properties allow for dynamic querying of the input elements available on a profile. API-Since: 14.0
      • allocWithZone

        public static GCPhysicalInputProfile 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 GCPhysicalInputProfile capture()
        Polls the state vector of the physical input input and saves it to a new and writable instance of GCPhysicalInputProfile. 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 user input once it is taken.
        Returns:
        A new physical input profile with the duplicated state vector of the current physical input API-Since: 14.0
        See Also:
        snapshot
      • 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()
      • device

        @Nullable
        public @Nullable GCDevice device()
        A profile keeps a reference to the device that this profile is mapping input from API-Since: 14.0
      • elements

        @NotNull
        public @NotNull NSDictionary<java.lang.String,​? extends GCControllerElement> elements()
        The following properties allow for runtime lookup of any input element on a profile, when provided with a valid alias. [@example] extendedGamepad.elements["Button A"] == extendedGamepad.buttonA // YES [@example] extendedGamepad.dpads["Left Thumbstick"] == extendedGamepad.leftThumbstick // YES [@example] extendedGamepad.dpads["Button B"] // returns nil, "Button B" is not a GCControllerDirectionPad API-Since: 14.0
      • hash_static

        public static long hash_static()
      • 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)
      • lastEventTimestamp

        public double lastEventTimestamp()
        The last time elements of this profile were updated. API-Since: 14.0
      • objectForKeyedSubscript

        @Nullable
        public @Nullable GCControllerElement objectForKeyedSubscript​(@NotNull
                                                                     @NotNull java.lang.String key)
        Profile elements can be accessed using keyed subscript notation, with a valid alias of its inputs. [@example] extendedGamepad["Button A"] == extendedGamepad.buttonA // YES [@example] microGamepad["Button X"] == microGamepad.buttonX // YES [@note] Equivalent to -elements API-Since: 14.0
      • resolveClassMethod

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

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

        public void setStateFromPhysicalInput​(@NotNull
                                              @NotNull GCPhysicalInputProfile physicalInput)
        Sets the state vector of the physical input profile to a copy of the passed in physical input profile's state vector. [@note] If the controller's snapshot flag is set to NO, this method has no effect.
        See Also:
        API-Since: 14.0
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

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

        public static long version_static()
      • hasRemappedElements

        public boolean hasRemappedElements()
        Whether the user has remapped their physical input controls for this profile at the system level. On iOS and tvOS, users can remap their game controller inputs in Settings. API-Since: 15.0
      • mappedElementAliasForPhysicalInputName

        @NotNull
        public @NotNull java.lang.String mappedElementAliasForPhysicalInputName​(@NotNull
                                                                                @NotNull java.lang.String inputName)
        Returns the primary alias of the GCControllerElement that a given physical input maps to. If the user were to map a physical press of the A button of their game controller to the B button, then -[GCPhysicalInputProfile mappedElementAliasForPhysicalInputName: GCInputButtonA] would return GCInputButtonB. Note that mappings can change anytime your app is backgrounded, so make sure you update any relevant visuals when returning to foreground. [@returns] A GCInput string corresponding to the primary alias of the GCControllerElement that a given physical button maps to, or nil if there is no mapping. API-Since: 15.0
        Parameters:
        inputName - A GCInput string corresponding to the physical button you want the mapped element alias for.
      • mappedPhysicalInputNamesForElementAlias

        @NotNull
        public @NotNull NSSet<java.lang.String> mappedPhysicalInputNamesForElementAlias​(@NotNull
                                                                                        @NotNull java.lang.String elementAlias)
        Returns a set of GCInput strings corresponding to physical inputs that are mapped to a given GCControllerElement. If the user mapped the physical press of the A button, the B button, and the X button to the B button, then -[GCPhysicalInputProfile mappedPhysicalInputNamesForElementAlias: GCInputButtonB] would return [GCInputButtonA, GCInputButtonB, GCInputButtonX]. Note that mappings can change anytime your app is backgrounded, so make sure you update any relevant visuals when returning to foreground. [@returns] A set of GCInput strings corresponding to physical inputs that are mapped to a given GCControllerElement, or an empty set if there are no mappings. API-Since: 15.0
        Parameters:
        elementAlias - A GCInput string corresponding to an alias of the GCControllerElement you want the physical buttons for.
      • setValueDidChangeHandler

        public void setValueDidChangeHandler​(@Nullable
                                             @Nullable GCPhysicalInputProfile.Block_setValueDidChangeHandler value)
        Set this block if you want to be notified when a value on a element changed. If multiple elements have changed this block will be called for each element that changed.
        Parameters:
        profile - this profile that is being used to map the raw input data into logical values on controller elements such as the dpad or the buttons.
        element - the element that has been modified. API-Since: 16.0
      • valueDidChangeHandler

        @Nullable
        public @Nullable GCPhysicalInputProfile.Block_valueDidChangeHandler_ret valueDidChangeHandler()
        Set this block if you want to be notified when a value on a element changed. If multiple elements have changed this block will be called for each element that changed.
        Parameters:
        profile - this profile that is being used to map the raw input data into logical values on controller elements such as the dpad or the buttons.
        element - the element that has been modified. API-Since: 16.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.