Package apple.gamecontroller.protocol
Interface GCPhysicalInputSource
-
public interface GCPhysicalInputSourceA description of the actual physical input element that a user interacts with to manipulate the the value of an input that is exposed to the app. By querying the source of an element's input that is returned from \c GCDevicePhysicalInput or \c GCDevicePhysicalInputState, an app can see through element remappings applied by the user in the system game controller settings. For example, assuming the user has swapped the A and B buttons in the system game controller settings... YES == [physicalInput.buttons[GCInputButtonA].pressedInput.source.elementAliases contains:GCInputButtonB] YES == [physicalInput.buttons[GCInputButtonB].pressedInput.source.elementAliases contains:GCInputButtonA] Examining an input's source is discouraged, but may be necessary depending on how your game's input handling code is implemented. If possible, prefer to load and display the \c sfSymbolsName and \c localizedName from the \c GCPhysicalInputElement in any in-game U.I. // Use these anywhere you need to instruct the user to press the 'A' // button in your game UI. The symbol name and localized string // returned will reflect the element that GCInputButtonA has been // remapped to (Button B in the above case). physicalInput.buttons[GCInputButtonA].localizedName physicalInput.buttons[GCInputButtonA].sfSymbolsName [@note] Objects conforming to \c GCPhysicalInputSource protocol are vended by the GameController framework. You should not conform to this protocol in your own types. API-Since: 17.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longdirection()One or more directions associated with the source.@NotNull NSSet<java.lang.String>elementAliases()The set of aliases for the element that the user interacts with.@Nullable java.lang.StringelementLocalizedName()The localized name of the element that the user interacts with.@Nullable java.lang.StringsfSymbolsName()The SF Symbol of the element that the user interacts with.
-
-
-
Method Detail
-
direction
long direction()
One or more directions associated with the source.
-
elementAliases
@NotNull @NotNull NSSet<java.lang.String> elementAliases()
The set of aliases for the element that the user interacts with.
-
elementLocalizedName
@Nullable @Nullable java.lang.String elementLocalizedName()
The localized name of the element that the user interacts with.
-
sfSymbolsName
@Nullable @Nullable java.lang.String sfSymbolsName()
The SF Symbol of the element that the user interacts with.
-
-