# Game Control Plus - Multiple gamepad inputs allowed?

**URL:** https://discourse.processing.org/t/game-control-plus-multiple-gamepad-inputs-allowed/19520
**Category:** Libraries
**Created:** [April 8, 2020, 3:22am UTC](https://discourse.processing.org/t/game-control-plus-multiple-gamepad-inputs-allowed/19520 "2020-04-08T03:22:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ella5980](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ella5980/32/8721_2.png) [@Ella5980](https://discourse.processing.org/u/Ella5980)
#### Post date: [April 8, 2020, 3:22am UTC](https://discourse.processing.org/t/game-control-plus-multiple-gamepad-inputs-allowed/19520/1 "2020-04-08T03:22:14Z")

</div>

Hello,  
I am a student programmer and I am working on a project where I am using Logitech gamepads to control a remotely operated vehicle (ROV). I was playing around with the Game Control Plus as an option to achieve this.

My question is does Game Control Plus allow inputs from two different gamepads? If multiple gamepads are allowed does anyone have any recommendations for tutorials to walk me through the process. I have not been able to find this information myself and I thought it would be a good time to ask the experts!

Thanks in advance!

@quark

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [April 8, 2020, 3:06pm UTC](https://discourse.processing.org/t/game-control-plus-multiple-gamepad-inputs-allowed/19520/2 "2020-04-08T15:06:47Z")

</div>

I have not tried using multiple identical devices with GCP because I don’t have them but it should work, hopefully 🙏

1. Create a configuration file for a gamepad and call it something like “gamepadconfig”
2. Now use the `getMatchedDevice` method twice to get the two gamepads. The code will look something like this

```auto
import org.gamecontrolplus.gui.*;
import org.gamecontrolplus.*;
import net.java.games.input.*;

ControlIO control;
Configuration config;
ControlDevice gpad0, gpad1;

public void setup() {
  size(400, 240);
  surface.setTitle("GCP Duel Gamepad trial");
  // Initialise the ControlIO
  control = ControlIO.getInstance(this);
  // Find a gamepad that matches the configuration file. To match with any 
  // connected device remove the call to filter.
  gpad0 = control.filter(GCP.GAMEPAD).getMatchedDevice("gamepadconfig");
  if (gpad0 == null) {
    println("No suitable device configured");
    System.exit(-1); // End the program NOW!
  }
  // Find a second gamepad that matches the configuration file. It should ignore 
  // devices already matched.
  gpad1 = control.filter(GCP.GAMEPAD).getMatchedDevice("gamepadconfig");
  if (gpad1 == null) {
    println("No suitable device configured");
    System.exit(-1); // End the program NOW!
  }

}

```

I am not promising it will work but what the heck 😄

For more information about this library visit my [website](http://www.lagers.org.uk/gamecontrol/index.html).

BTW welcome to the forum 👍

---

<div class="post-metadata">

### Author: ![Ella5980](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ella5980/32/8721_2.png) [@Ella5980](https://discourse.processing.org/u/Ella5980)
#### Post date: [April 8, 2020, 6:18pm UTC](https://discourse.processing.org/t/game-control-plus-multiple-gamepad-inputs-allowed/19520/4 "2020-04-08T18:18:34Z")

</div>

Thank you so much! I appreciate that you took the time to help me out.

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [April 8, 2020, 6:30pm UTC](https://discourse.processing.org/t/game-control-plus-multiple-gamepad-inputs-allowed/19520/5 "2020-04-08T18:30:58Z")

</div>

You’re welcome and when you get to try it I would be interested in hearing if this worked. 😄

---

<div class="post-metadata">

### Author: ![Ella5980](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ella5980/32/8721_2.png) [@Ella5980](https://discourse.processing.org/u/Ella5980)
#### Post date: [April 8, 2020, 6:48pm UTC](https://discourse.processing.org/t/game-control-plus-multiple-gamepad-inputs-allowed/19520/6 "2020-04-08T18:48:10Z")

</div>

I will definitely share. By the way I just found your videos and they are super helpful.
