FreeStick  0.3
Cross Platform Open Sorce Joystick Lib
FSMFIJoystick.h
Go to the documentation of this file.
1 /**************************************************************************
2 Created by Alan Uthoff on 10/13/2013
3 Copyright (C) 2019
4 
5 This Code is free software; you can redistribute it and/or
6 modify it under the terms of the zlib/libpng License as published
7 by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9 This software is provided 'as-is', without any express or implied warranty.
10 
11 In no event will the authors be held liable for any damages arising from the use of this software.
12 
13 Permission is granted to anyone to use this software for any purpose,
14 including commercial applications, and to alter it and redistribute
15 it freely, subject to the following restrictions:
16 
17 1. The origin of this software must not be misrepresented;
18 you must not claim that you wrote the original software.
19 If you use this software in a product, an acknowledgment
20 in the product documentation would be appreciated but is not required.
21 
22 2. Altered source versions must be plainly marked as such,
23 and must not be misrepresented as being the original software.
24 
25 3. This notice may not be removed or altered from any source distribution.
26 **************************************************************************/
27 
28 #pragma once
30 #define UP_DPAD_MFI_EID 589836
31 #define DOWN_DPAD_MFI_EID 589837
32 #define LEFT_DPAD_MFI_EID 589838
33 #define RIGHT_DPAD_MFI_EID 589839
34 
35 #define A_BUTTON_MFI_EID 589825
36 #define B_BUTTON_MFI_EID 589826
37 #define X_BUTTON_MFI_EID 589827
38 #define Y_BUTTON_MFI_EID 589828
39 
40 #define MENU_BUTTON_MFI_EID 589834
41 
42 #define LEFT_SHOULDER_BUTTON_MFI_EID 589829
43 #define RIGHT_SHOULDER_BUTTON_MFI_EID 589830
44 
45 #define LEFT_AXIS_BUTTON_MFI_EID 589831
46 #define RIGHT_AXIS_BUTTON_MFI_EID 589832
47 
48 #define LEFT_XAXIS_MFI_EID 65584
49 #define LEFT_YAXIS_MFI_EID 65585
50 
51 #define RIGHT_XAXIS_MFI_EID 65587
52 #define RIGHT_YAXIS_MFI_EID 65588
53 
54 #define LTRIGGER_MFI_EID 65586
55 #define RTRIGGER_MFI_EID 65589
56 
57 #define APPLE_VENDER_ID 123
58 #define MFI_PRODUCT_ID 123
59 
60 namespace freestick
61 {
63  {
64  public:
65  FSMFIJoystick();
66  // Using void here to get around poluting the header file with objective-c
67  FSMFIJoystick(void * controller,idNumber joyStickID,
68  unsigned int numberOfButtons,
69  unsigned int numberOfAnlogSticks,
70  unsigned int numberOfDigitalSticks,
71  bool forceFeedBackSupported,
72  vendorIDType vendorID,
73  productIDType productID);
74  bool setElementValue(elementID element,float value);
75  protected:
76  void addButtonElement(unsigned int buttonID);
77  void addElement(unsigned int buttonID,minMaxNumber min,minMaxNumber max,physicalValueNumber currentValue);
78  void addMFIElements();
80  };
81 }
void addMFIElements()
Definition: FSMFIJoystick.mm:56
FSMFIJoystick()
Definition: FSMFIJoystick.mm:6
void addElement(unsigned int buttonID, minMaxNumber min, minMaxNumber max, physicalValueNumber currentValue)
Definition: FSMFIJoystick.mm:96
minMaxNumber _totalButtonNumber
Definition: FSMFIJoystick.h:79
uint32_t idNumber
Definition: FSTypes.h:33
Definition: FSMFIJoystick.h:62
uint32_t productIDType
Definition: FSTypes.h:39
Definition: FSBaseDevice.h:32
Definition: FSUSBJoystick.h:36
unsigned int numberOfButtons(IOHIDDeviceRef device)
Definition: FSUSBMacOSXJoystickDeviceManager.mm:282
void addButtonElement(unsigned int buttonID)
Definition: FSMFIJoystick.mm:90
uint32_t vendorIDType
Definition: FSTypes.h:38
unsigned int elementID
Definition: FSTypes.h:36
bool setElementValue(elementID element, float value)
Definition: FSMFIJoystick.mm:43
int32_t physicalValueNumber
Definition: FSTypes.h:35
int32_t minMaxNumber
Definition: FSTypes.h:34