![](/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/USBKeyboard.h@0:beb124b81ef5, 2011-08-02 (annotated)
- Committer:
- henryeherman
- Date:
- Tue Aug 02 02:58:40 2011 +0000
- Revision:
- 0:beb124b81ef5
Just barley work
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
henryeherman | 0:beb124b81ef5 | 1 | #include "usbhid.h" |
henryeherman | 0:beb124b81ef5 | 2 | |
henryeherman | 0:beb124b81ef5 | 3 | #ifndef MBED_USBKEYBOARD_H |
henryeherman | 0:beb124b81ef5 | 4 | #define MBED_USBKEYBOARD_H |
henryeherman | 0:beb124b81ef5 | 5 | |
henryeherman | 0:beb124b81ef5 | 6 | /* Class: USBKeyboard |
henryeherman | 0:beb124b81ef5 | 7 | * Emulate a USB Keyboard HID device |
henryeherman | 0:beb124b81ef5 | 8 | * |
henryeherman | 0:beb124b81ef5 | 9 | * Example: |
henryeherman | 0:beb124b81ef5 | 10 | * > #include "mbed.h" |
henryeherman | 0:beb124b81ef5 | 11 | * > #include "USBKeyboard.h" |
henryeherman | 0:beb124b81ef5 | 12 | * > |
henryeherman | 0:beb124b81ef5 | 13 | * > USBKeyboard kb; |
henryeherman | 0:beb124b81ef5 | 14 | * > |
henryeherman | 0:beb124b81ef5 | 15 | * > int main() { |
henryeherman | 0:beb124b81ef5 | 16 | * > while(1) { |
henryeherman | 0:beb124b81ef5 | 17 | * > kb.sendKeys("Foo goes here!"); |
henryeherman | 0:beb124b81ef5 | 18 | * > wait(2); |
henryeherman | 0:beb124b81ef5 | 19 | * > } |
henryeherman | 0:beb124b81ef5 | 20 | * > } |
henryeherman | 0:beb124b81ef5 | 21 | */ |
henryeherman | 0:beb124b81ef5 | 22 | class USBKeyboard : private usbhid { |
henryeherman | 0:beb124b81ef5 | 23 | public: |
henryeherman | 0:beb124b81ef5 | 24 | /* Constructor: USBKeyboard |
henryeherman | 0:beb124b81ef5 | 25 | * Create a USB Keyboard using the mbed USB Device interface |
henryeherman | 0:beb124b81ef5 | 26 | */ |
henryeherman | 0:beb124b81ef5 | 27 | USBKeyboard(); |
henryeherman | 0:beb124b81ef5 | 28 | |
henryeherman | 0:beb124b81ef5 | 29 | void sendKeys(char *szString); |
henryeherman | 0:beb124b81ef5 | 30 | void sendKey(char c); |
henryeherman | 0:beb124b81ef5 | 31 | |
henryeherman | 0:beb124b81ef5 | 32 | |
henryeherman | 0:beb124b81ef5 | 33 | private: |
henryeherman | 0:beb124b81ef5 | 34 | |
henryeherman | 0:beb124b81ef5 | 35 | }; |
henryeherman | 0:beb124b81ef5 | 36 | |
henryeherman | 0:beb124b81ef5 | 37 | #endif |