summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/user/hid.h48
-rw-r--r--nids/360/SceHid.yml2
2 files changed, 38 insertions, 12 deletions
diff --git a/include/user/hid.h b/include/user/hid.h
index 327fce3..1fe133b 100644
--- a/include/user/hid.h
+++ b/include/user/hid.h
@@ -8,27 +8,32 @@ extern "C" {
#include <psp2/types.h>
typedef struct SceHidKeyboardReport {
- SceUInt8 unk0[2];
- SceUInt8 modifier;
- SceUInt8 key1;
- SceUInt8 key2;
- SceUInt8 key3;
- SceUInt8 key4;
- SceUInt8 key5;
- SceUInt8 key6;
+ SceUInt8 reserved;
+ SceUInt8 modifiers[2]; //modifiers[0] Standard modifiers Ctrl Shift Alt, modifiers[1] Caps Lock, ..?
+ SceUInt8 keycodes[6];
SceUInt8 unk1[15];
} SceHidKeyboardReport;
-#define SCE_HID_KEYBOARD_MAX_REPORT 16
+typedef struct SceHidMouseReport {
+ SceUInt8 buttons;
+ SceUInt8 reserved;
+ SceInt16 rel_x;
+ SceInt16 rel_y;
+ SceInt8 unk[10];
+
+} SceHidMouseReport;
+
+#define SCE_HID_MAX_REPORT 16
+#define SCE_HID_MAX_DEVICE_COUNT 8
/**
* Enumerate hid keyboards.
*
- * @param[out] handle Hid handle.
- * @param[int] port? Use 1.
+ * @param[out] handle Buffer to receive keyboard hid handles.
+ * @param[int] count Number of keyboards to enumerate
*/
-int sceHidKeyboardEnumerate(int* handle, int port);
+int sceHidKeyboardEnumerate(int* handle, int count);
/**
@@ -40,6 +45,25 @@ int sceHidKeyboardEnumerate(int* handle, int port);
*/
int sceHidKeyboardRead(SceUInt32 handle, SceHidKeyboardReport *reports[], int nReports);
+/**
+ * Enumerate hid mice.
+ *
+ * @param[out] handle Buffer to receive mouse hid handles.
+ * @param[int] count Number of mice to enumerate
+ */
+int sceHidMouseEnumerate(int* handle, int count);
+
+
+/**
+ * Get hid mouse reports.
+ *
+ * @param[in] handle Hid handle.
+ * @param[in] reports Buffer to receive reports.
+ * @param[in] nReports Number of reports to receive.
+ */
+int sceHidMouseRead(SceUInt32 handle, SceHidMouseReport *reports[], int nReports);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/nids/360/SceHid.yml b/nids/360/SceHid.yml
index c1d1299..5346e0f 100644
--- a/nids/360/SceHid.yml
+++ b/nids/360/SceHid.yml
@@ -7,3 +7,5 @@ modules:
functions:
sceHidKeyboardEnumerate: 0x34BDFACE
sceHidKeyboardRead: 0x224A8AD8
+ sceHidMouseEnumerate: 0x2A0D2F54
+ sceHidMouseRead: 0xBDECBDC0