git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

JoyKit/JOYController.h

      1 #import <Foundation/Foundation.h>
      2 #import "JOYButton.h"
      3 #import "JOYAxis.h"
      4 #import "JOYAxes2D.h"
      5 #import "JOYAxes3D.h"
      6 #import "JOYHat.h"
      7 
      8 static NSString const *JOYAxes2DEmulateButtonsKey = @"JOYAxes2DEmulateButtons";
      9 static NSString const *JOYHatsEmulateButtonsKey = @"JOYHatsEmulateButtons";
     10 
     11 @class JOYController;
     12 
     13 @protocol JOYListener <NSObject>
     14 
     15 @optional
     16 -(void) controllerConnected:(JOYController *)controller;
     17 -(void) controllerDisconnected:(JOYController *)controller;
     18 -(void) controller:(JOYController *)controller buttonChangedState:(JOYButton *)button;
     19 -(void) controller:(JOYController *)controller movedAxis:(JOYAxis *)axis;
     20 -(void) controller:(JOYController *)controller movedAxes2D:(JOYAxes2D *)axes;
     21 -(void) controller:(JOYController *)controller movedAxes3D:(JOYAxes3D *)axes;
     22 -(void) controller:(JOYController *)controller movedHat:(JOYHat *)hat;
     23 
     24 @end
     25 
     26 typedef enum {
     27     JOYControllerCombinedTypeSingle,
     28     JOYControllerCombinedTypeComponent,
     29     JOYControllerCombinedTypeCombined,
     30 } JOYControllerCombinedType;
     31 
     32 typedef enum {
     33     JOYJoyConTypeNone,
     34     JOYJoyConTypeLeft,
     35     JOYJoyConTypeRight,
     36     JOYJoyConTypeDual,
     37 } JOYJoyConType;
     38 
     39 @interface JOYController : NSObject
     40 + (void)startOnRunLoop:(NSRunLoop *)runloop withOptions: (NSDictionary *)options;
     41 + (NSArray<JOYController *> *) allControllers;
     42 + (void) registerListener:(id<JOYListener>)listener;
     43 + (void) unregisterListener:(id<JOYListener>)listener;
     44 - (JOYControllerCombinedType)combinedControllerType;
     45 - (NSArray<JOYButton *> *) buttons;
     46 - (NSArray<JOYAxis *> *) axes;
     47 - (NSArray<JOYAxes2D *> *) axes2D;
     48 - (NSArray<JOYAxes3D *> *) axes3D;
     49 - (NSArray<JOYHat *> *) hats;
     50 - (NSArray<JOYInput *> *) allInputs;
     51 - (void)setRumbleAmplitude:(double)amp;
     52 - (void)setPlayerLEDs:(uint8_t)mask;
     53 - (uint8_t)LEDMaskForPlayer:(unsigned)player;
     54 @property (readonly, getter=isConnected) bool connected;
     55 @property (readonly) JOYJoyConType joyconType;
     56 @property (readonly) NSString *deviceName;
     57 @property (readonly) NSString *uniqueID;
     58 @property (nonatomic) bool usesHorizontalJoyConGrip;
     59 @end
     60 
     61 @interface JOYCombinedController : JOYController
     62 - (instancetype)initWithChildren:(NSArray<JOYController *> *)children;
     63 - (void)breakApart;
     64 @property (readonly) NSArray<JOYController *> *children;
     65 @end
     66 
     67 
     68 

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.