20#ifdef OBJFWHID_LOCAL_INCLUDES
24# if defined(__has_feature) && __has_feature(modules)
27# import <ObjFW/OFObject.h>
28# import <ObjFW/OFString.h>
33#import "OHExtendedGamepad.h"
35OF_ASSUME_NONNULL_BEGIN
37@class OFArray OF_GENERIC(ObjectType);
39@class OHGameControllerProfile;
51#ifdef OF_HAVE_CLASS_PROPERTIES
52@property (
class, readonly, nonatomic)
53 OFArray <OHGameController *> *controllers;
74@property (readonly, nonatomic) id <OHGameControllerProfile>
profile;
80@property OF_NULLABLE_PROPERTY (readonly, nonatomic) id <OHGamepad>
gamepad;
86@property OF_NULLABLE_PROPERTY (readonly, nonatomic)
96- (instancetype)
init OF_UNAVAILABLE;
112extern const uint16_t OHVendorIDSony;
113extern const uint16_t OHVendorIDNintendo;
114extern const uint16_t OHVendorIDMicrosoft;
115extern const uint16_t OHVendorIDGoogle;
116extern const uint16_t OHVendorID8BitDo;
117extern const uint16_t OHProductIDDualShock4;
118extern const uint16_t OHProductIDDualSense;
119extern const uint16_t OHProductIDLeftJoyCon;
120extern const uint16_t OHProductIDRightJoyCon;
121extern const uint16_t OHProductIDProController;
122extern const uint16_t OHProductIDN64Controller;
123extern const uint16_t OHProductIDSNESController;
124extern const uint16_t OHProductIDXbox360WirelessReceiver;
125extern const uint16_t OHProductIDStadiaController;
126extern const uint16_t OHProductIDNES30Gamepad;
127extern const uint16_t OHProductIDUltimate2CWirelessBT;
128extern const uint16_t OHProductIDUltimate2CWirelessUSB;
An abstract class for storing objects in an array.
Definition OFArray.h:109
Provides a way to store a number in an object.
Definition OFNumber.h:47
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
instancetype init()
Initializes an already allocated object.
Definition OFObject.m:696
id copy()
Returns the class.
Definition OFObject.m:1407
A class for handling strings.
Definition OFString.h:143
A class for reading state from a game controller.
Definition OHGameController.h:47
OFNumber * productID
The product ID of the controller or nil if unavailable.
Definition OHGameController.m:109
OFString * name
The name of the controller.
Definition OHGameController.h:59
id< OHGameControllerProfile > profile
The profile for the game controller.
Definition OHGameController.h:74
OFNumber * vendorID
The vendor ID of the controller or nil if unavailable.
Definition OHGameController.m:104
id< OHGamepad > gamepad
The gamepad profile for the game controller, or nil if not supported.
Definition OHGameController.m:119
id< OHExtendedGamepad > extendedGamepad
The extended gamepad profile for the game controller, or nil if not supported.
Definition OHGameController.m:124
void updateState()
Updates the current state from the game controller.
Definition OHGameController.m:114
OFArray * controllers()
Returns the available controllers.
Definition OHGameController.m:70