|
-
Sep 11th, 2005, 06:33 PM
#1
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
-
Sep 11th, 2005, 07:04 PM
#2
Re: 2 keyboards
Can you plug two keyboards into a computer period?
-
Sep 11th, 2005, 07:07 PM
#3
Re: 2 keyboards
Yes, there is a PS2 Y adapter like the ones that come with barcode scanners.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 11th, 2005, 07:31 PM
#4
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.
-
Sep 11th, 2005, 07:47 PM
#5
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 11th, 2005, 07:50 PM
#6
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?
-
Sep 11th, 2005, 07:51 PM
#7
Re: 2 keyboards
And the start and stop are just ASCII keycodes, anyways.
-
Sep 11th, 2005, 07:54 PM
#8
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 11th, 2005, 08:34 PM
#9
Frenzied Member
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.
-
Sep 11th, 2005, 10:03 PM
#10
Fanatic Member
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.
-
Sep 11th, 2005, 11:45 PM
#11
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
-
Sep 12th, 2005, 07:11 AM
#12
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|