1 of 1 people found this helpful
I think this link from Microsoft describes about the phenomenon observed by you:
Interesting link, thanks.
I wonder why it never came up in the googling I've done on this in the past week trying to figure out how Windows handles Keyboards.
This looks like it could give me support for some extra keys/layouts, like Japanese 106/109 key layout in the example, but doesn't seem to cover what I'm looking to do: have the ability for the OS recognize any arbitrary code between 0x66 and 0xDD on an English layout. I wonder if there's an english layout out there I could assign that would support, say F13-F24 (0x68-0x73). I'll have to do some digging.
It's looking like the only way to do this may be to have a custom driver? Which is strange to me since I thought the entire point of the HID spec was that this could all just work without additional configuration. Using these F13-F24 keycodes is actually a customer requirement, so I wonder if perhaps they've already got a driver for it and I just haven't been privy to that information...
Should the USB Descriptor I posted be OK on the microcontroller end? From what I can determine it should be doing it's job in letting the OS know those key codes can come from they keyboard, even if the OS/driver doesn't account for them, from a HID compliance standpoint that descriptor is OK?
Thanks for the lead, this is more info than I had yesterday.
I'm not an expert in this discussion but here goes:
There are non-english keyboards available such as the Japanese Katakana keyboards and I believe the Chinese have keyboards to support may of their symbols. These keyboard goes beyond the standard 101 keys and must have support with a USB HID. How do they do it? If you can figure it out, you're probably half-way there.
You're right, I could probably get at a couple of these codes by having the OS (Windows) use a different layout such as Japanese/106 or similar. But if I switch the layout for this keyboard to something like Japanese/106 then I'm suddenly typing in Katakana. I want a standard 101 key US layout, the only difference is I have some extra buttons on the PSoC that I want to use as F13-F24 keys. Keys I know will not be duplicated on the 101-US keyboard. I can send the HID codes for these keys just fine, but the OS will not recognize any key is being pressed because they are not included in a standard 101 key US layout, so I'm guessing that Windows is filtering them out as "not real codes".
I was hoping setting up the descriptor to tell the USB host that they keycodes can range between 0x00 and 0xDD would nudge the host into accepting these keys but it seems that is not the case.
I don't think it's an issue with the HID interface. HID Protocol specifies the codes (see page 53 here). I think it's probably an issue with getting the host OS to accept these codes as "real keys". F13, F14, and F15 are actually accepted on mac systems according to the document I linked above, as well as a number of additional keys. I'd bet that if I plugged into a mac, F13,F14, and F15 would suddenly work. I just can't seem to figure out how to get windows to cooperate.
Currently looking into creating a custom layout using Microsoft Keyboard Layout Creator. Maybe it'll let me do what I need to do, but it's blocked by the group policy on my machine for some reason. I'll check back in if I manage to get it installed and can mess around with it.
No luck with Microsoft Keyboard Layout Creator. Looks like it only lets you edit the main block of keys and nothing else, so I can't do something like add additional "valid" keys. Back to the drawing board I suppose.
This has kind of gotten off track from being a PSoC question, so getting slightly back on topic, can anyone tell me if my descriptor is OK? I'd like to confirm that the issues I'm having are on the host side rather than the PSoC side.
Thanks, that is quite helpful, if even to just have a nice commented reference for a HID keyboard descriptor (also, I didn't notice you could have comments in a descriptor. I will be sure to make use of that in the future)
The descriptor in that project calls out key codes (USAGE MIN/MAX and LOGICAL MIN/MAX) 0-255, whereas mine calls out 0-221, but they generally look the similar aside from the example not having Keyboard LEDs. This is more and more pushing me to thinking that it's an issue with the host, and for Windows at least, a custom driver may be needed (although I haven't gotten a 100% crystal clear answer on if that's true). I would hope, since our customer specifically asked for these HID codes, that they have a host that supports them.
I made a StackOverflow question regarding properly handing of these code in a C# .NET Winforms application if anyone is having a similar issue and wants to keep an eye on it. Figured it belonged more there than here since it's not really a PSoC related issue.