Spektre Posted August 23, 2006 Posted August 23, 2006 Hello, How woudl you go about accessing two keybaords in the same application? Say a head to head game. Two monitors is trivial to support thru the OS. How would you access two keyboards though? Direct HID calls? Can anyone point me to an example? Spektre Quote
Cags Posted August 23, 2006 Posted August 23, 2006 To the best of my knowledge, if you had two keyboards attached to the same PC then either, only one would work or more likely both would work the same. Basically they would both send the same messages so would be indistiguishable. If you wished to have two players from the same PC they would have to have different keys. But if the players are anything like me they would use the other keys to throw of your opponent, lol. Quote Anybody looking for a graduate programmer (Midlands, England)?
Leaders snarfblam Posted August 23, 2006 Leaders Posted August 23, 2006 I have two keyboards and three mice hooked up to my computer (wired/wireless sets). I have never seen an application treat them as separate devices, however the advantage is that although a keyboard can only send so many keys to the computer at a time, with two keyboards you can send twice as many keystrokes (good for emulators, which are, of course, only used in a manner consistent with the law). If there is any way to distinguish the source of the keystrokes, however, you would have to get pretty low level. I do not believe that DirectX can provide this kind of data to you, and I'm nearly positive that Windows API won't. I would say that maybe setting up a hook would be your best bet (although I believe that some anti-virus or anti-spyware software will report system-wide keyboard hooks as key loggers). Not incredibly helpful, but maybe a starting point. Quote [sIGPIC]e[/sIGPIC]
Spektre Posted August 24, 2006 Author Posted August 24, 2006 Thanks for the insights. Seperate keys will not work, as the players need access to the full alphabet. No idea how to do low level keyboard hooks. Two networked PCs would work, but what a waste... Thanks again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.