File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -1149,7 +1149,7 @@ elseif(Haiku)
11491149 src/detection/host/host_windows.c
11501150 src/detection/icons/icons_nosupport.c
11511151 src/detection/initsystem/initsystem_haiku.cpp
1152- src/detection/keyboard/keyboard_nosupport.c
1152+ src/detection/keyboard/keyboard_haiku.cpp
11531153 src/detection/libc/libc_nosupport.c
11541154 src/detection/lm/lm_nosupport.c
11551155 src/detection/loadavg/loadavg_nosupport.c
Original file line number Diff line number Diff line change 1+ extern " C" {
2+ #include " keyboard.h"
3+ #include " common/io/io.h"
4+ }
5+
6+ #include < interface/Input.h>
7+ #include < support/List.h>
8+
9+ const char * ffDetectKeyboard (FFlist* devices /* List of FFKeyboardDevice */ )
10+ {
11+ BList list;
12+ BInputDevice *device;
13+
14+ if (get_input_devices (&list) != B_OK)
15+ {
16+ return NULL ;
17+ }
18+
19+ int32 i, n = list.CountItems ();
20+ for (i = 0 ; i < n; i++)
21+ {
22+ device = (BInputDevice *) list.ItemAt (i);
23+ if (device->Type () != B_KEYBOARD_DEVICE)
24+ continue ;
25+
26+ FF_STRBUF_AUTO_DESTROY name = ffStrbufCreateS (device->Name ());
27+ if (!device->IsRunning ())
28+ ffStrbufAppendS (&name, " (stopped)" );
29+
30+ FFKeyboardDevice* device = (FFKeyboardDevice*) ffListAdd (devices);
31+ ffStrbufInitStatic (&device->serial , " " );
32+ ffStrbufInitMove (&device->name , &name);
33+ }
34+
35+ return NULL ;
36+ }
You can’t perform that action at this time.
0 commit comments