summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/user/hid.h48
-rw-r--r--nids/360/SceHid.yml9
2 files changed, 57 insertions, 0 deletions
diff --git a/include/user/hid.h b/include/user/hid.h
new file mode 100644
index 0000000..327fce3
--- /dev/null
+++ b/include/user/hid.h
@@ -0,0 +1,48 @@
+#ifndef _PSP2_HID_H_
+#define _PSP2_HID_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#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 unk1[15];
+
+} SceHidKeyboardReport;
+
+#define SCE_HID_KEYBOARD_MAX_REPORT 16
+
+/**
+ * Enumerate hid keyboards.
+ *
+ * @param[out] handle Hid handle.
+ * @param[int] port? Use 1.
+ */
+int sceHidKeyboardEnumerate(int* handle, int port);
+
+
+/**
+ * Get hid keyboard reports.
+ *
+ * @param[in] handle Hid handle.
+ * @param[in] reports Buffer to receive reports.
+ * @param[in] nReports Number of reports to receive.
+ */
+int sceHidKeyboardRead(SceUInt32 handle, SceHidKeyboardReport *reports[], int nReports);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/nids/360/SceHid.yml b/nids/360/SceHid.yml
new file mode 100644
index 0000000..c1d1299
--- /dev/null
+++ b/nids/360/SceHid.yml
@@ -0,0 +1,9 @@
+modules:
+ SceHid:
+ nid: 0x76B8FA74
+ libraries:
+ SceHid:
+ nid: 0xE23FAD62
+ functions:
+ sceHidKeyboardEnumerate: 0x34BDFACE
+ sceHidKeyboardRead: 0x224A8AD8