mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
Mouse (Haiku): add support
This commit is contained in:
parent
c1c59cff6d
commit
bfa59d2c04
@ -1158,7 +1158,7 @@ elseif(Haiku)
|
||||
src/detection/gamepad/gamepad_nosupport.c
|
||||
src/detection/media/media_linux.c
|
||||
src/detection/memory/memory_haiku.c
|
||||
src/detection/mouse/mouse_nosupport.c
|
||||
src/detection/mouse/mouse_haiku.cpp
|
||||
src/detection/netio/netio_nosupport.c
|
||||
src/detection/opengl/opengl_linux.c
|
||||
src/detection/os/os_haiku.c
|
||||
|
36
src/detection/mouse/mouse_haiku.cpp
Normal file
36
src/detection/mouse/mouse_haiku.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
extern "C" {
|
||||
#include "mouse.h"
|
||||
#include "common/io/io.h"
|
||||
}
|
||||
|
||||
#include <interface/Input.h>
|
||||
#include <support/List.h>
|
||||
|
||||
const char* ffDetectMouse(FFlist* devices /* List of FFMouseDevice */)
|
||||
{
|
||||
BList list;
|
||||
BInputDevice *device;
|
||||
|
||||
if (get_input_devices(&list) != B_OK)
|
||||
{
|
||||
return "get_input_devices() failed";
|
||||
}
|
||||
|
||||
int32 i, n = list.CountItems();
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
device = (BInputDevice *) list.ItemAt(i);
|
||||
if (device->Type() != B_POINTING_DEVICE)
|
||||
continue;
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreateS(device->Name());
|
||||
if (!device->IsRunning())
|
||||
ffStrbufAppendS(&name, " (stopped)");
|
||||
|
||||
FFMouseDevice* device = (FFMouseDevice*) ffListAdd(devices);
|
||||
ffStrbufInit(&device->serial);
|
||||
ffStrbufInitMove(&device->name, &name);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user