![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Acts a USB HID keyboard, and socket server. Forwards characters from TCP ip socket to keyboard
Dependencies: mbed EthernetNetIf
USBKeyboardMouse/usbhid.h@1:d866a9d23e49, 2018-12-14 (annotated)
- Committer:
- henryeherman
- Date:
- Fri Dec 14 01:15:44 2018 +0000
- Revision:
- 1:d866a9d23e49
- Parent:
- 0:beb124b81ef5
init
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
henryeherman | 0:beb124b81ef5 | 1 | /* usbhid.h */ |
henryeherman | 0:beb124b81ef5 | 2 | /* USB HID class device */ |
henryeherman | 0:beb124b81ef5 | 3 | /* Copyright (c) Phil Wright 2008 */ |
henryeherman | 0:beb124b81ef5 | 4 | |
henryeherman | 0:beb124b81ef5 | 5 | #ifndef USBHID_H |
henryeherman | 0:beb124b81ef5 | 6 | #define USBHID_H |
henryeherman | 0:beb124b81ef5 | 7 | |
henryeherman | 0:beb124b81ef5 | 8 | #include "usbdevice.h" |
henryeherman | 0:beb124b81ef5 | 9 | |
henryeherman | 0:beb124b81ef5 | 10 | /* Mouse buttons */ |
henryeherman | 0:beb124b81ef5 | 11 | #define MOUSE_L (1<<0) |
henryeherman | 0:beb124b81ef5 | 12 | #define MOUSE_M (1<<1) |
henryeherman | 0:beb124b81ef5 | 13 | #define MOUSE_R (1<<2) |
henryeherman | 0:beb124b81ef5 | 14 | |
henryeherman | 0:beb124b81ef5 | 15 | class usbhid : public usbdevice |
henryeherman | 0:beb124b81ef5 | 16 | { |
henryeherman | 0:beb124b81ef5 | 17 | public: |
henryeherman | 0:beb124b81ef5 | 18 | usbhid(); |
henryeherman | 0:beb124b81ef5 | 19 | bool keyboard(char c); |
henryeherman | 0:beb124b81ef5 | 20 | bool keyboard(char *string); |
henryeherman | 0:beb124b81ef5 | 21 | bool mouse(signed char x, signed char y, unsigned char buttons=0, signed char wheel=0); |
henryeherman | 0:beb124b81ef5 | 22 | protected: |
henryeherman | 0:beb124b81ef5 | 23 | virtual bool requestSetConfiguration(); |
henryeherman | 0:beb124b81ef5 | 24 | virtual void endpointEventEP1In(void); |
henryeherman | 0:beb124b81ef5 | 25 | virtual void deviceEventReset(void); |
henryeherman | 0:beb124b81ef5 | 26 | virtual bool requestGetDescriptor(void); |
henryeherman | 0:beb124b81ef5 | 27 | virtual bool requestSetup(void); |
henryeherman | 0:beb124b81ef5 | 28 | private: |
henryeherman | 0:beb124b81ef5 | 29 | bool sendInputReport(unsigned char id, unsigned char *data, unsigned char size); |
henryeherman | 0:beb124b81ef5 | 30 | }; |
henryeherman | 0:beb124b81ef5 | 31 | |
henryeherman | 0:beb124b81ef5 | 32 | #endif |