Using multiple keyboards

Ruidong Chen's Avatar

Ruidong Chen

04 Nov, 2020 01:20 PM

This comment was split from the discussion: MWorks interactive game design

Hi Chris,

I am trying to set up a multiplayer game where separate keyboards control
two avatars on the same screen. When I tried to start the demo you sent
initially, I got the 'multiple matching HID devices' error pasted below. I
was able to run the demo by specifying preferred_location_id as prompted.
My question is if I want to allow for input from two keyboards, is there a
way to read key presses from both?

ERROR: Found multiple matching HID devices for "joystick":

Device #1

Product: Apple Internal Keyboard / Trackpad

Manufacturer: Apple Inc.

Location ID: 2152726528 (0x80500000)

Device #2

Product: Magic Keyboard with Numeric Keypad

Manufacturer: Apple

Location ID: 343706896 (0x147c8d10)

Device #3

Please set the "preferred_location_id" attribute to the Location ID of the
desired device.

Thanks,
Ruidong

  1. Support Staff 1 Posted by Christopher Sta... on 04 Nov, 2020 01:26 PM

    Christopher Stawarz's Avatar

    Hi Ruidong,

    Yes, you can use multiple keyboards. You just need to define two separate USB HID devices and set preferred_location_id on each of them.

    Cheers,
    Chris

  2. 2 Posted by Ruidong Chen on 05 Nov, 2020 02:38 PM

    Ruidong Chen's Avatar

    Got it to work with two keyboards now. Thanks so much for your help!

  3. Christopher Stawarz closed this discussion on 05 Nov, 2020 03:42 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac