Page 1 of 1

XMBC Simulated Keys via external hardware (arduino) device

Posted: Fri Nov 03, 2023 6:18 pm
by phil
So, after a few discussions with people on the discord channel, I have been playing with using an Arduino to send simulated keystrokes instead of the MS SendInput APIs.

The Arduino is a tiny, cheap USB device that runs custom firmware. It is able to act as a USB HID device, and thus its just like a physical keyboard, but programmable. Ive written a simple firmware that XMBC can communicates with, and send keys that way. This means that the keys come from what appears to Windows as a standard, physical keyboard, which in turn means that the keys should work in any application, even if they don't accept simulated input (SendInput).

Curious to see if anyone is interested in testing it? If you are you will needs an Arduino based Pro Micro (may work with clones that use the ATmega32U4 CPU and support HID and serial communication at the same time - maybe all, I don't know) And it may need some further tweaks/config in XMBC for devices other than the Pro Micro (that I got amazon UK for about £12).

It's obviously a bit advanced, and still in its early stages, but it seems to be working for me. Its a bit slower than using SendInput, because each key down and up is sent to the device over its virtual serial COM port and waits until the device acknowledges it, but it can repeat keys at about 50-60ms. This can probably be improved but will require a lot more coding on the Arduino - and Im only just learning that :lol:.