We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01d3765 commit 8e5c2adCopy full SHA for 8e5c2ad
src/detection/gamepad/gamepad_haiku.cpp
@@ -0,0 +1,21 @@
1
+extern "C" {
2
+#include "gamepad.h"
3
+}
4
+#include <Joystick.h>
5
+
6
+const char* ffDetectGamepad(FFlist* devices /* List of FFGamepadDevice */)
7
+{
8
+ BJoystick js;
9
+ for (int32 i = 0, n = js.CountDevices(); i < n; ++i)
10
+ {
11
+ char name[B_OS_NAME_LENGTH];
12
+ if (js.GetDeviceName(i, name) == B_OK)
13
14
+ FFGamepadDevice* device = (FFGamepadDevice*) ffListAdd(devices);
15
+ ffStrbufInit(&device->serial);
16
+ ffStrbufInitS(&device->name, name);
17
+ device->battery = 0;
18
+ }
19
20
+ return NULL;
21
0 commit comments