Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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.
Anybody looking for a graduate programmer (Midlands, England)?
  • Leaders
Posted

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.

[sIGPIC]e[/sIGPIC]
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...