-
2 keyboards
i am making a game and want to know if i could have 2 keyboards pluged in2 the same computer and differenciate between commands typed on one keyboard and the other, so that each player has their own input.
ne suggestions?
thanks in advance
kris bennett
-
Re: 2 keyboards
Can you plug two keyboards into a computer period?
-
Re: 2 keyboards
Yes, there is a PS2 Y adapter like the ones that come with barcode scanners. ;)
-
Re: 2 keyboards
But you cannot distinguish between what was sent by the scanner or the keyboard. You might be able to use the MIDI port as a Joystick, or even two. I know that is possible.
-
Re: 2 keyboards
Sure you can. BarCodes have a start and stop character. If you scan a BC you can trap for these chars and know its coming from the scanner. ;)
-
Re: 2 keyboards
But if we're talking about two keyboards, as per the original question, wouldn't ASCII 64 be identical coming from either one, hence removing identity of which keyboard was used?
-
Re: 2 keyboards
And the start and stop are just ASCII keycodes, anyways.
-
Re: 2 keyboards
I was just responding to post #4 where dglienna states you cant tell which device the input s coming from - scanner or keyboard. ;)
With 2 keyboards only, you cant.
-
Re: 2 keyboards
You could connect the second keyboard to a serial port instead of the regular port.
It would require a physical adaptor and software to talk to the keyboard and translate it's data.
The tricky part would be making the adaptor, for example; the PS/2 needs a clock but the serial ports doesn't have one.
http://www.computer-engineering.org/ps2keyboard/
You could also get a USB keyboard and write a custom driver for it.
Of course, that would require driver-programming skills and knowledge of the USB keyboard's lowlevel protocols.
There are programmable keyboard controllers to which you can wire buttons.
You can program it to send a certain key sequence when a certain button is pressed.
If you get two then you could make a rule that one puts an "a" before each character and that the other puts a "b" before each character.
You then read the keyboard input by two's and test whether the first character is an "a" or a "b".
It is a bit expensive and requires you to do a lot of soldering.
If you have a second PC 'doing nothing' then you could make a small program that sends all keyboard input over the network to the other PC.
Or make your application 'dual-PC'.
The easiest way would be to divide the keyboard in a player 1 and a player 2 section (so each has his own keys).
This gives each user the comfort of his own (physical) keyboard but you'll have to divide the keys and nothing will stop a user from pressing the other user's keys.
-
Re: 2 keyboards
Idea:
Can you remap a certain keyboard to where the key codes would be outside of what the other one is?
Don't think so, look in device manager, are they seen as 2 different devices?
If so you might be able to use it with DirectInput (DX8).
Don't think any of those would work, but there just some ideas. :)
-
Re: 2 keyboards
Use the joystick port. Don't think you can use a full keyboard, but I've seen number pads with joysticks in them
-
Re: 2 keyboards