Function Keys 16-24

Hey guys! It seems that Unity only has mapped KeyCodes the first 15 function keys. I’m trying to implement a custom USB controller that specifically sends keystrokes from the range of F13-F24. How would I get this input into Unity?

I wrote a simple C# script outside of Unity to detect the input (simple Console.ReadKey() commands), and Windows recognizes these keys just fine. The USB controller is not listed by Unity. It isn’t in the list of “unsupported devices” when I look at the Input Debugger, presumably because it is already detected as a keyboard?

For what it’s worth, the application I’m developing will only ever be used on Windows machines.

Hi, unfortunately as of right now we don’t have a great support for extended keyboard buttons, we have very similar problem on Android also where a lot of keycodes are not mapped to anything. We will take this into consideration for future refactoring of our native code, so it will be possible to get the data if one needs.

I think the easiest way for you right now would be to pinvoke into GetAsyncKeyState and create a custom input device with buttons. A more involved way would be to override our wndproc and intercept windows events directly like rewired does, but that is plenty of work.