Figured I'd pick/ping the talent here to see if anybody knows of a project, before I re-invent the wheel here.
I am currently using a (more or less) Leonardo and a USB Host Shield, with a normal USB keyboard attached to it..
before I start on the other effects/behavior I need in this project.. I need to get a base state hashed out where the keyboard acts 'as normal', and passes on all key strokes (and behaves) as normal.
I was a bit flawed in my understanding of the USB Host Shield/Library, where I thought it (by default) passed on the keystrokes/presses onto the end device. However this is not the case, and only mirrors the output to the serial monitor.
So I have been using these example HIDBootKBD sketch here:
and hooking into the methods available to pass on the keypresses to the end device, using the keyboard.write()..etc functions:
that being said... I need to account for the modifiers, control keys, repeating keys...etc.. so the keyboard still functions as normal and without error/incident...
I figured someone may have been down this road before? And already done what I'd like to do?
anyone have any links? tuts?..etc to share to perhaps help me along on this?
I have only gotten single 'characters' to pass through to the end device, no carriage returns, no control keys, no modifiers...etc..
The only approach in my head is to get some sort of long switch/case statement to detect when a special key has been pressed?
(ie: how to know what was pressed, in order to know what data to pass along using the keyboard class..etc) doing it for basic 'characters' was easy as you just pass along the: "Serial.println((char)key);"
Looking for some inspiration (clues) on the proper and easiest way to tackle this.