Split screen player devices !?

I have the same problem and have been searching for a solution. So far my solution is a rather cumbersome workaround. So if others here have a better option please tell.

Input are handled by two singletons “Input” and “InputEvent”.
The former has more methods that are relevant to a game where you will often need different behavior depending if you press/hold/release keys/buttons.
The latter is a more general class, and will have less methods aimed at serving inputs you actually need in a game.

The problem is now that Input does not come with a property of what device pressed it. Only “InputEvent” has the property .device.

The workaround is therefore to manually add all devices separately in your input mapping. like “controller1_jump = joypad_0, device 0”, “controller2_jump = joypad_0, device 1”, “keyboard_jump = spacebar”, etc.etc.

As I said, the workaround is quite annoying, but it is the best method I found so far.
My guess is that there must be a way to connect Input and InputEvent and carry over the property. But I am a noob too, so I have not been able to figure it out.

3 Likes