> -----Original Message----- > From: piclist-bounces@mit.edu On Behalf Of Josh Koffman > Sent: Tuesday, December 27, 2005 10:21 PM > > > I'm still at the breadboarding stage, and one thing that keeps rearing > its head is that something isn't working quite right with modifier > keys. So, I can send a specific keycode to the host just great. I'm > using the HID usage table to come up with my codes. For instance, a > 'J' (0x0D) works great. But if I stuff my send buffer with a left > shift (0xE1) and then a 'J', I still get a lowercase J. I thought > perhaps my code wasn't working the send buffer correctly...but if I > stuff two letters in at once, I get two letters out. Sorry for the late reply, I'm moving during the holidays. To send just a modifier key you send its code, not likely what you want. Your sequence above would send the shift key press/release and then the "j" key press/release. To send a shifted "j" key you set the left or right shift key bit in the modifier byte of the packet and put the "j" key code as the key array data. The information about modifier keys is in "Device Class Definition for Human Interface Devices (HID)" document from the USB Implementers Forum. To send your first name properly capitalized to notepad you set the modifier byte to have a shift and put "j" as the only key in the data array and send it. Next you clear the modifier byte and load "o", "s" and "h" in the data array and send the packet. > > This evening I tried with a left control (0xE0). This is obviously > harder to debug as I can't just open notepad and watch for > capitalization. However, my results are consistent, it seems as though > the control key isn't being sent. So I'm thinking now that the > modifier keys are perhaps dealt with differently. Does anyone have any > idea if this is true? And if it is, how do I deal with them? To help with debugging the control key in notepad send Ctrl+O. When you get it right notepad will show the file open dialog. Hope this helps, Paul > > If I can't figure this out here, I'm going to try and contact the > author of that code through the Microchip forums. > > Thanks! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist