diff --git a/src/userland/hid/hid.h b/src/userland/hid/hid.h new file mode 100644 index 0000000..45a57be --- /dev/null +++ b/src/userland/hid/hid.h @@ -0,0 +1,18 @@ +#ifndef HID_H +#define HID_H + +#include + +typedef struct { + uint32_t serviceId; + uint32_t deviceId; + uint32_t normalFunction; + void *buffer; +} HIDDevice; + +typedef struct { + uint8_t buttons; + int8_t x, y; +} __attribute__((packed)) MouseReport; + +#endif diff --git a/src/userland/hid/hid.h b/src/userland/hid/hid.h new file mode 100644 index 0000000..45a57be --- /dev/null +++ b/src/userland/hid/hid.h @@ -0,0 +1,18 @@ +#ifndef HID_H +#define HID_H + +#include + +typedef struct { + uint32_t serviceId; + uint32_t deviceId; + uint32_t normalFunction; + void *buffer; +} HIDDevice; + +typedef struct { + uint8_t buttons; + int8_t x, y; +} __attribute__((packed)) MouseReport; + +#endif diff --git a/src/userland/hid/main.c b/src/userland/hid/main.c index 769c355..7b7ef96 100644 --- a/src/userland/hid/main.c +++ b/src/userland/hid/main.c @@ -1,24 +1,14 @@ #define ALLOC_MAIN #include +#include "hid.h" + REQUEST(checkFocus, "ioManager", "checkFocus"); REQUEST(moveRelative, "mouse", "moveRelative"); REQUEST(updateButtons, "mouse", "updateButtons"); ListElement *hidDevices = NULL; -typedef struct { - uint32_t serviceId; - uint32_t deviceId; - uint32_t normalFunction; - void *buffer; -} HIDDevice; - -typedef struct { - uint8_t buttons; - int8_t x, y; -} __attribute__((packed)) MouseReport; - void hidListening(HIDDevice *device) { while (1) { request(device->serviceId, device->normalFunction, device->deviceId, U32(getPhysicalAddress(device->buffer)));