ysjoyreader.h
Go to the documentation of this file.
1 #ifndef YSMACOSXJOYSTICK_IS_INCLUDED
2 #define YSMACOSXJOYSTICK_IS_INCLUDED
3 /* { */
4 
8 
9 #include <stdio.h>
10 #include <unistd.h>
11 #include <stdlib.h>
12 #include <ctype.h>
13 #include <sys/errno.h>
14 #include <sysexits.h>
15 #include <IOKit/hid/IOHIDLib.h>
16 
17 
18 
20 {
21 public:
22  int exist;
23  IOHIDElementRef elem;
24  int value;
25 
27 };
28 
30 {
31 public:
32  int min,max;
33  int scaledMin,scaledMax;
34  int calibCenter,calibMin,calibMax;
35 
37  double GetCalibratedValue(void) const;
38 
39  void CaptureCenter(void);
40  void BeginCaptureMinMax(void);
41  void CaptureMinMax(void);
42  void CenterFromMinMax(void);
43 };
44 
46 {
47 public:
49 };
50 
52 {
53 public:
56  int value0Deg;
60  int GetDiscreteValue(void) const;
61 };
62 
64 {
65 public:
66  static IOHIDManagerRef hidManager;
67  static CFMutableArrayRef devArray;
68 
69  int joyId;
70  IOHIDDeviceRef hidDev;
71  char regPath[512];
72 
76 
77  YsJoyReader();
78  int SetUpInterface(int joyId,IOHIDDeviceRef hidDev);
79  void Read(void);
80  void ReleaseInterface(void);
81 
82  int WriteCalibInfoFile(FILE *fp) const;
83  int ReadCalibInfoFile(FILE *fp);
84 
85 protected:
86  void AddAxis(int axisId,IOHIDElementRef elem,int min,int max,int scaledMin,int scaledMax);
87 
88 public:
89  static int SetUpJoystick(int &nJoystick,YsJoyReader joystick[],int maxNumJoystick);
90 };
91 
92 
93 
94 
95 int YsJoyReaderSetUpJoystick(int &nJoystick,YsJoyReader joystick[],int maxNumJoystick);
96 
97 FILE *YsJoyReaderOpenJoystickCalibrationFile(const char mode[]);
98 
101 
102 /* } */
103 #endif
int YsJoyReaderLoadJoystickCalibrationInfo(int nJoystick, YsJoyReader joystick[])
#define max(a, b)
static CFMutableArrayRef devArray
Definition: ysjoyreader.h:67
static IOHIDManagerRef hidManager
Definition: ysjoyreader.h:66
const int YsJoyReaderMaxNumHatSwitch
Definition: ysjoyreader.h:7
IOHIDDeviceRef hidDev
Definition: ysjoyreader.h:70
#define min(a, b)
const int YsJoyReaderMaxNumAxis
Definition: ysjoyreader.h:5
const int YsJoyReaderMaxNumButton
Definition: ysjoyreader.h:6
Definition: js.h:6
IOHIDElementRef elem
Definition: ysjoyreader.h:23
FILE * YsJoyReaderOpenJoystickCalibrationFile(const char mode[])
int YsJoyReaderSaveJoystickCalibrationInfo(int nJoystick, YsJoyReader joystick[])
int YsJoyReaderSetUpJoystick(int &nJoystick, YsJoyReader joystick[], int maxNumJoystick)


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:51