From 76424950e373d3b04ac3dd13019151bfba3e8423 Mon Sep 17 00:00:00 2001 From: sumuel Date: Mon, 17 Aug 2026 20:44:55 +0000 Subject: Add the files --- src/detection/keyboard/keyboard_haiku.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/detection/keyboard/keyboard_haiku.cpp (limited to 'src/detection/keyboard/keyboard_haiku.cpp') diff --git a/src/detection/keyboard/keyboard_haiku.cpp b/src/detection/keyboard/keyboard_haiku.cpp new file mode 100644 index 0000000..dc1d28a --- /dev/null +++ b/src/detection/keyboard/keyboard_haiku.cpp @@ -0,0 +1,27 @@ +extern "C" { +#include "keyboard.h" +} + +#include +#include + +const char* ffDetectKeyboard(FFlist* devices /* List of FFKeyboardDevice */) { + 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_KEYBOARD_DEVICE || !device->IsRunning()) { + continue; + } + + FFKeyboardDevice* item = FF_LIST_ADD(FFKeyboardDevice, *devices); + ffStrbufInit(&item->serial); + ffStrbufInitS(&item->name, device->Name()); + } + + return NULL; +} -- cgit v1.2.3