XboxWASD in FreePIE

In my venture into VR I sometimes bump into experiences which only take keyboard and mouse input. To feel less tied down I usually opt for using a wireless Xbox360 gamepad, and this weekend I figured that there has to be a way to emulate keyboard and mouse controls with said controller.

Sure, a bit of searching later and I found FreePIE which can receive controller input and send keyboard and mouse output! At this point I had never done Python or used this software before, but I found a script floating around that showed me how to do the basic in/out operation. From there it was just about reading Python documentation and experimenting with FreePIE!

I’ve introduced two main improvements to the quite basic script I started with. The stick input was fairly square and not very accurate so I rewrote that to handle things better.

  • Both sticks now have a circular dead-zones instead of square.
  • The left stick is divided into pie pieces that better handles diagonal movement.
  • The right stick has a scaling input field in relation to the dead-zone and a vector based output.

The image to the right describes what I just said a bit easier, the red side is how the script originally worked, green side is my rewrite, top is movement (keyboard) and bottom is aiming (mouse).

The script can easily be customized by editing the settings at the top of the file. To use this you need an Xbox 360 controller, wired or wireless with dongle, FreePIE installed and the below script file. Just open FreePIE, locate the file, make adjustments and press F5 to run it. Enjoy! :)

Xbox360 Controller to Keyboard & Mouse for FreePIE

It is a .zip because WordPress will not allow me to upload .py files, understandably. Version number is just an integer as I iterated from 1 and onward.

Version History

12. Dead-zones for triggers, option to use dpad for other keys than movement. Bugfix for start button crash.

11. Initial release, vector based aiming with full range outside dead-zone. Equally segmented movement. Circular dead-zones for both sticks. Start button glitch work-around. Easy customization.

5 Responses to XboxWASD in FreePIE

  1. thank for this!

    Can you make the inverse? (keyboard to xbox360)

    thanks

  2. I looked into that when I made this and it was not at all as straight forward as the reverse :/ Apparently it would require a custom driver that emulates a controller, which I’m not sure exists yet, so right now that feature is not planned, sorry :)

  3. I have a really Controler Xbox360 but following a car accident, I can not use it.

    but thank you for fast reply

  4. Rob says:

    Actually there is a driver called the scpdriver you can also use the xoutput.dll plugin for freepie and then if you have windows 10 you can stream your xbox one and play with keyboard and mouse unfortunatlly i cant figure out how to use the mouse like an analog stick so the mouse is a bit choppy and harder to use than a regular controller as of now….who knows maybe andreas can look at the script and rearrange it so here ya go https://github.com/dschu012/XOutputPlugin

  5. scrub says:

    Thanks so much for your great script! Feels great to play old C64 games with a Xbox Controller again!

Leave a Reply