Edit update 24 Apr 2012: I think I have a better understanding now and will briefly update this original query. I am pretty sure the behavior I am seeing is normal. My previous experience with decoding USB keys was at a relatively low level (the "event" level, where events reported key presses and key releases etc.). I believe the data packets I am dealing with in USBHostShell are at a "lower level" and I need to process the packets to keep track of key presses and releases. I think I will be able to deal with this successfully.
----------------------------
I am trying to use USBHostShell to handle a USB keyboard. I have integrated the USBHostShell into my program and as long as I do not press multiple keys too close together in time it works correctly. I can use a single finger to poke the keys: 1234567 etc. as fast as possible with no problem. But when I try to actually type normally, any time that a single returned packet has more than one key code present, I almost always get a second or even third packet with some duplicate key codes. The data dump below is from a simultaneous, rapid, poke with two fingers on the number keys 1 and 2.
data 8: 00 00 1E 1F 00 00 00 00
data 8: 00 00 1E 00 00 00 00 00
I believe I should only get the one line that has the two key codes (1E and 1F). Perhaps it is something to do with the polling rate by the Host interface? I have not been able to find what determines the host polling rate of the keyboard.
I am using Peter Barrett's USBHostShell from Apr 2010 and will next attempt to use Ad van der Weiden's myUSBHost from July 2011, just in case there is some subtle difference that will eliminate my problem.
Unfortunately I know nothing about USB programming or C++. Although I have managed to make more progress in my project than I thought possible, this will be a killer for me if I cannot figure out why this is happening, so any hints or suggestions of things to look for will be greatly appreciated.
Chuck
Edit update 24 Apr 2012: I think I have a better understanding now and will briefly update this original query. I am pretty sure the behavior I am seeing is normal. My previous experience with decoding USB keys was at a relatively low level (the "event" level, where events reported key presses and key releases etc.). I believe the data packets I am dealing with in USBHostShell are at a "lower level" and I need to process the packets to keep track of key presses and releases. I think I will be able to deal with this successfully.
----------------------------I am trying to use USBHostShell to handle a USB keyboard. I have integrated the USBHostShell into my program and as long as I do not press multiple keys too close together in time it works correctly. I can use a single finger to poke the keys: 1234567 etc. as fast as possible with no problem. But when I try to actually type normally, any time that a single returned packet has more than one key code present, I almost always get a second or even third packet with some duplicate key codes. The data dump below is from a simultaneous, rapid, poke with two fingers on the number keys 1 and 2.
data 8: 00 00 1E 1F 00 00 00 00
data 8: 00 00 1E 00 00 00 00 00
I believe I should only get the one line that has the two key codes (1E and 1F). Perhaps it is something to do with the polling rate by the Host interface? I have not been able to find what determines the host polling rate of the keyboard.
I am using Peter Barrett's USBHostShell from Apr 2010 and will next attempt to use Ad van der Weiden's myUSBHost from July 2011, just in case there is some subtle difference that will eliminate my problem.
Unfortunately I know nothing about USB programming or C++. Although I have managed to make more progress in my project than I thought possible, this will be a killer for me if I cannot figure out why this is happening, so any hints or suggestions of things to look for will be greatly appreciated.
Chuck