Multiple mice and keyboards support

I managed to build a custom SDL library (from libSDL 1.2 sources) that exposes the source of mouse & keyboard events. People interested in how I did that will find the patch there: patch. It uses XI2/RawEvents. It’s very hackish and ugly, but it does the job. Note that it probably breaks stuffs useless to the sixaxis emulator.

This allows to use several mice and keyboards with the sixaxis emulator, which is a nice feature to play split-screen FPS games with friends 🙂

Multiple sixaxis emulators

It’s working!

As you can see in the following screenshot, I am able to launch two emu processes that communicate with my PS3, each one using a different bluetooth adapter. I then can connect an emuclient process to one of them.


The next task is to connect the same emuclient to both emu processes, so that each emu process can send commands to the PS3 at the same time.

This will need some more work, as the SDL 1.2 library (that is used to get events from input devices) is not supporting multiple mice and multiple keyboards. It supports multiple game devices though (joysticks, wheels, gamepads…).

EDIT:

It’s not working for the following stuff:

– connect to a PS3 that already has a real sixaxis connected
– connect a real sixaxis after a sixaxis emulator and change the controller id

The ultimate sixaxis emulator

Several input devices (keyboards, mice, wheels, joysticks…), several bluetooth dongles…

Guess what?

I’m thinking to make the sixaxis emulator capable of emulating several sixaxis at the same time, and reading several input devices at the same time (several mice, several keyboards…).

The emuclient process (responsible for grabbing input events) will connect to several emu processes (responsible for connecting and sending data to the PS3).

The bad thing is that the SDL 1.2 is not designed to handle multiple mice/keyboards (unlike joysticks). For mice and keyboards, the origin of an event can’t be known.

With the coming SDL 1.3, it seems that multiple mice can be handled at the same time thanks to the merge of the ManyMouse library.

I looked closer to the source code, and it seems that multiple keyboard can be handled by the SDL 1.3 too!

EDIT 12/06: the multi-mouse / multi-keyboard support has been removed from the trunk of the SDL library. It will be re-added in a near future => the multiple sixaxis emulator is postponed.