nesdev.com
http://forums.nesdev.com/

Raw Input: Read multiple USB keyboards on Windows
http://forums.nesdev.com/viewtopic.php?f=3&t=16548
Page 1 of 1

Author:  tepples [ Wed Oct 04, 2017 3:34 pm ]
Post subject:  Raw Input: Read multiple USB keyboards on Windows

The Raw Input API in Windows allows a program to read multiple distinct keyboards, such as two USB keyboards or a USB keyboard and a laptop's internal keyboard, and take different actions for (say) Space on one and Space on the other. It reportedly works for mice as well, and I imagine it'd be the only viable way to emulate two Zappers, two Arkanoid Controllers, two Super NES Mouse controllers, or one of each. Which emulators support Raw Input, and which plan to?

Author:  2600 [ Thu Oct 05, 2017 5:36 am ]
Post subject:  Re: Raw Input: Read multiple USB keyboards on Windows

tepples wrote:
The Raw Input API in Windows allows a program to read multiple distinct keyboards, such as two USB keyboards or a USB keyboard and a laptop's internal keyboard, and take different actions for (say) Space on one and Space on the other. It reportedly works for mice as well, and I imagine it'd be the only viable way to emulate two Zappers, two Arkanoid Controllers, two Super NES Mouse controllers, or one of each. Which emulators support Raw Input, and which plan to?


MAME has for quite a while. I'm not aware of any other emulators that do, but only because I haven't followed the release notes as much with other emulators.

Author:  zeroone [ Thu Oct 05, 2017 7:21 am ]
Post subject:  Re: Raw Input: Read multiple USB keyboards on Windows

There are several input APIs that serve as abstraction layers on top of lower level APIs like Windows Raw Input; so, if the keyboard mapping within an emulator is able to discern between multiple keyboards, then it might be using it indirectly.

One of the strange things that I discovered about the lower level keyboard APIs is that some keyboards have non-default key codes for certain keys. If the user is forced to map all the buttons to keyboard keys in a setup screen before ever using the emulator, then the user will never experience this effect. It's only when the emulator tries to establish default keyboard codes that some problems might arise.

Also, lower level keyboard APIs also exhibit different key auto-repeat behaviors; meaning, after a period of holding a key down, the sequence of events that follow may vary.

I should also point out that higher level keyboard APIs do not necessarily remedy these effects. Dealing with the wide range of keyboard craziness is a pain.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/