Results 1 to 12 of 12

Thread: 2 keyboards

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    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

  2. #2
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: 2 keyboards

    Can you plug two keyboards into a computer period?

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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.

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  6. #6
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    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?

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: 2 keyboards

    And the start and stop are just ASCII keycodes, anyways.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  9. #9
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    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.

  10. #10
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    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.
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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

  12. #12
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: 2 keyboards

    Moved from ClassicVb.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width