1
\$\begingroup\$

I'm trying to make a stenotype-teaching game using the stenoboard as input. The Stenoboard emulates an NKRO keyboard, using this code: https://github.com/caru/StenoFW/blob/master/StenoFW.ino, with an Arduino Leonardo as the controller.

My XNA code is unremarkable, and works fine with other keyboards. The Stenoboard works fine with other programs. However, when plugged into XNA, it registers nothing unless all keys are mashed repeatedly, in which case it will register one or two random keys for a single frame.

This issue also exists in Monogame and across multiple machines running both Windows 7 and 8. The Stenoboard presents itself as a PS/2 keyboard on my W8 laptop, but as a USB keyboard on my W7 desktop. I'm fairly certain XNA's keyboard library just doesn't like the signals the 'board is sending.

My question is: A) does anyone know a way to fix this, and if not, B) is there another way to harvest keyboard events from Windows and feed them into XNA? I'm currently thinking of adding a Windows Form to the project and using it to catch Keydown and Keyup events and mail them to the game, but since the form would have to be in focus at all times, that seems like a recipe for user error.

\$\endgroup\$
  • \$\begingroup\$ By 'other programs' have you tried it in any other games? It could possibly be an issue where the data from the keyboard isn't being sent in the span of a single frame. (I say this because the arduino code appeared to not be using any interrupts and so might be taking longer than 0.016s to poll, debounce and send. Emphasis on might). \$\endgroup\$ – XNargaHuntress Jun 25 '15 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.