Coder Social home page Coder Social logo

gdsports / xac-mouse2joy Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 2.0 396 KB

Xbox Adaptive Controller Mouse to Joystick Converter

License: MIT License

C++ 100.00%
arduino teensy xac xbox xbox-adaptive-controller mouse joystick trackball gamepad touchpad

xac-mouse2joy's Introduction

Mouse to Joystick for Xbox Adaptive Controller

The Microsoft Xbox Adaptive Controller (XAC) ignores all USB HID devices except for joysticks. This project converts USB HID mouse messages into USB HID joystick messages. This allows the use of USB mice, track balls, and some touchpads. For example, this small touchpad works. Large touchpads usually require custom device drivers so are not USB HID mouse compatible so will not work with this project.

NOTE: Using joysticks, keyboards, mice, track balls, etc. with consoles is not new. If you do not need the XAC for button and switch inputs, consider the following alternatives. Or use one of the following with an XAC if you do not want to bother with building this project. I have not used any of them so you will have to investigate on your own.

XAC with touchpad

Features

  • Mouse/track ball/touch pad movement maps to the right thumbstick.
  • Primary/Left mouse button maps to gamepad X button.
  • Secondary/Right mouse button maps to gamepad Y button.
  • If present, third button maps to gamepad Right Bumper.
  • If present, fourth button maps to gamepad Right Stick.
  • The button mapping can be change by a configuration file stored on a micro SD card.

Configuration file on micro SD card

Create a file on a micro SD card at the top level with the name MSE2JOY.JSN and put the following three lines in the file.

Default button mapping.

{
 "mapMouseButtons": [ 4, 5, 3, 2, 6, 7, 0, 1 ]
}
Xbox Button Name Xbox Button Number
View 0
Menu 1
right stick 2
right bumper 3
X 4
Y 5
X1 6
X2 7

The default mapping means the first mouse button (usually the primary/left button) maps to the Xbox button 4 which is the X button. The second mouse button (usually the secondary/right button) maps to the Xbox button 5 which is the Y button.

Hardware components

  • 1 x PJRC Teensy 3.6 board (t36)
  • 1 x PJRC USB host cable
  • 1 x USB mouse, track ball, touch pad, etc. of your choice
  • Breadboard, headers, wire, etc.

The only soldering required is to attach the 5 pin header for the USB host cable. The other pins are not used.

Software

  • mouse2joy -- Mouse to joystick converter

Software build enviroment

Arduino IDE 1.8.7 and Teensyduino 1.44

  • Install Arduino IDE 1.8.7. Follow the instructions at arduino.cc.
  • Install TeensyDuino 1.44. Follow the instructions at pjrc.com.
  • Install the ArduinoJson library using library manager. Use the latest 5.x version which is 5.13.3 as of this writing. Do not use the 6.x beta version.
  • Unzip the patches for the joystick (joystick_teensy_20181201.zip) over the TeensyDuino files.
  • Set the board type to Teensy 3.6 and the USB Type to Joystick + Serial. The joystick options with keyboard and mouse do not work with the XAC.
  • Upload mouse2joy.ino to the t36.

Arduino IDE 1.8.8 and Teensyduino 1.45

  • Install Arduino IDE 1.8.8. Follow the instructions at arduino.cc.
  • Install TeensyDuino 1.45. Follow the instructions at pjrc.com.
  • Install the ArduinoJson library using library manager. Use the latest 5.x version which is 5.13.3 as of this writing. Do not use the 6.x beta version.
  • Unzip the patches for the joystick (joystick_teensy_1.45_20181212.zip) over the TeensyDuino files.
  • Set the board type to Teensy 3.6 and the USB Type to Joystick + Serial. The joystick options with keyboard and mouse do not work with the XAC.
  • Upload mouse2joy.ino to the t36.

How to use it

Plug the mouse, track ball, touchpad, etc. into the t36 USB host cable. Plug the t36 into the XAC right USB port using a micro USB cable. Moving the mouse should now be equivalent to moving the right thumb stick. If the device requires more power than the XAC can provide, unplug the mouse and plug a powered USB hub into the t36 USB host port. Plug the mouse into the powered hub. This is necessary for a Kensington Expert track ball. Other large devices or devices with LEDs may also require extra power. Another possible solution is to use the optional XAC power supply.

xac-mouse2joy's People

Contributors

gdsports avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xac-mouse2joy's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.