Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: USBKeyboardMouse/usbhid.h
- Revision:
- 0:4c75a597cb26
diff -r 000000000000 -r 4c75a597cb26 USBKeyboardMouse/usbhid.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/USBKeyboardMouse/usbhid.h Fri Jun 10 09:01:25 2011 +0000
@@ -0,0 +1,32 @@
+/* usbhid.h */
+/* USB HID class device */
+/* Copyright (c) Phil Wright 2008 */
+
+#ifndef USBHID_H
+#define USBHID_H
+
+#include "usbdevice.h"
+
+/* Mouse buttons */
+#define MOUSE_L (1<<0)
+#define MOUSE_M (1<<1)
+#define MOUSE_R (1<<2)
+
+class usbhid : public usbdevice
+{
+public:
+ usbhid();
+ bool keyboard(char c);
+ bool keyboard(char *string);
+ bool mouse(signed char x, signed char y, unsigned char buttons=0, signed char wheel=0);
+protected:
+ virtual bool requestSetConfiguration();
+ virtual void endpointEventEP1In(void);
+ virtual void deviceEventReset(void);
+ virtual bool requestGetDescriptor(void);
+ virtual bool requestSetup(void);
+private:
+ bool sendInputReport(unsigned char id, unsigned char *data, unsigned char size);
+};
+
+#endif
\ No newline at end of file