File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -1158,7 +1158,7 @@ elseif(Haiku)
11581158 src/detection/gamepad/gamepad_nosupport.c
11591159 src/detection/media/media_linux.c
11601160 src/detection/memory/memory_haiku.c
1161- src/detection/mouse/mouse_nosupport.c
1161+ src/detection/mouse/mouse_haiku.cpp
11621162 src/detection/netio/netio_nosupport.c
11631163 src/detection/opengl/opengl_linux.c
11641164 src/detection/os/os_haiku.c
Original file line number Diff line number Diff line change 1+ extern " C" {
2+ #include " mouse.h"
3+ #include " common/io/io.h"
4+ #include " util/stringUtils.h"
5+ }
6+
7+ #include < interface/Input.h>
8+ #include < support/List.h>
9+
10+ const char * ffDetectMouse (FFlist* devices /* List of FFMouseDevice */ )
11+ {
12+ BList list;
13+ BInputDevice *device;
14+
15+ if (get_input_devices (&list) != B_OK)
16+ {
17+ return NULL ;
18+ }
19+
20+ int32 i, n = list.CountItems ();
21+ for (i = 0 ; i < n; i++)
22+ {
23+ device = (BInputDevice *) list.ItemAt (i);
24+ if (device->Type () != B_POINTING_DEVICE)
25+ continue ;
26+
27+ FF_STRBUF_AUTO_DESTROY name = ffStrbufCreateS (device->Name ());
28+ if (!device->IsRunning ())
29+ ffStrbufAppendS (&name, " (stopped)" );
30+
31+ FFMouseDevice* device = (FFMouseDevice*) ffListAdd (devices);
32+ ffStrbufInitStatic (&device->serial , " " );
33+ ffStrbufInitMove (&device->name , &name);
34+ }
35+
36+ return NULL ;
37+ }
You can’t perform that action at this time.
0 commit comments