You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.5 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /***************************************************************************
  2. * Copyright (C) 2014 M Wellings *
  3. * info@openforeveryone.co.uk *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License version 2 as *
  7. * published by the Free Software Foundation *
  8. * *
  9. * This program is distributed in the hope that it will be useful, *
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  12. * GNU General Public License for more details. *
  13. * *
  14. * You should have received a copy of the GNU General Public License *
  15. * along with this program; if not, write to the *
  16. * Free Software Foundation, Inc., *
  17. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  18. ***************************************************************************/
  19. #ifndef QGAMECONTROLLER_MAC_P_H
  20. #define QGAMECONTROLLER_MAC_P_H
  21. #include <QMap>
  22. #include "qgamecontroller.h"
  23. #include "qgamecontroller_p.h"
  24. #include <IOKit/hid/IOHIDManager.h>
  25. #include <IOKit/HID/IOHIDKeys.h>
  26. CFMutableDictionaryRef hu_CreateDeviceMatchingDictionary(UInt32 inUsagePage, UInt32 inUsage);
  27. QString CFStringRefToQString(CFStringRef str);
  28. QT_BEGIN_NAMESPACE
  29. class QGameControllerPrivate
  30. {
  31. Q_DECLARE_PUBLIC(QGameController)
  32. public:
  33. explicit QGameControllerPrivate(uint id, QGameController *q);
  34. QGameController * const q_ptr;
  35. public:
  36. int fd;
  37. QString Description;
  38. uint ID;
  39. bool Valid;
  40. QMap<uint, float> AxisValues;
  41. QMap<uint, bool> ButtonValues;
  42. #ifdef Q_OS_MAC
  43. IOHIDDeviceRef device;
  44. QList<IOHIDElementRef> axisElements;
  45. QList<uint> axisMaxVals;
  46. QList<uint> axisMinVals;
  47. QList<IOHIDElementRef> buttonElements;
  48. #endif
  49. #ifdef Q_OS_WIN
  50. LPDIRECTINPUTDEVICE8 g_pJoystick;
  51. uint enumCounter;
  52. QList<GUID> DIaxisGIIDs;
  53. #endif
  54. uint Axis;
  55. uint Buttons;
  56. void readGameController();
  57. };
  58. QGAMECONTROLLER_MAC_P_H
  59. #endif // QGAMECONTROLLER_P_H