summaryrefslogtreecommitdiffstats
path: root/src/detection/mouse/mouse_haiku.cpp
diff options
context:
space:
mode:
authorsumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
committersumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
commit76424950e373d3b04ac3dd13019151bfba3e8423 (patch)
tree4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/detection/mouse/mouse_haiku.cpp
Add the files
Diffstat (limited to 'src/detection/mouse/mouse_haiku.cpp')
-rw-r--r--src/detection/mouse/mouse_haiku.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/detection/mouse/mouse_haiku.cpp b/src/detection/mouse/mouse_haiku.cpp
new file mode 100644
index 0000000..5835c8e
--- /dev/null
+++ b/src/detection/mouse/mouse_haiku.cpp
@@ -0,0 +1,27 @@
+extern "C" {
+#include "mouse.h"
+}
+
+#include <interface/Input.h>
+#include <support/List.h>
+
+const char* ffDetectMouse(FFlist* devices /* List of FFMouseDevice */) {
+ BList list;
+
+ if (get_input_devices(&list) != B_OK) {
+ return "get_input_devices() failed";
+ }
+
+ for (int32 i = 0, n = list.CountItems(); i < n; i++) {
+ BInputDevice* device = (BInputDevice*) list.ItemAt(i);
+ if (device->Type() != B_POINTING_DEVICE || !device->IsRunning()) {
+ continue;
+ }
+
+ FFMouseDevice* item = FF_LIST_ADD(FFMouseDevice, *devices);
+ ffStrbufInit(&item->serial);
+ ffStrbufInitS(&item->name, device->Name());
+ }
+
+ return NULL;
+}