I am making a car simulation game, however, I find it being inefficient and difficult to test the simulation realism and accuracy via keyboard or even joystick control. I need a steering wheel controller to do this. However, getting good steering wheel controllers is so difficult - they cost a lot. However, I noticed(when playing Real Racing 3) that the phone actually can handle such task kinda well.

What sort of code could I write to use a smart phone as a steering wheel?

Looking forward to see some useful answers ;)


Check out node-virtual-gamepads. It does almost what you want (doesn't seem to have accelerometer support yet). From its blurb:

This nodejs application provides the possibility to use your smarpthone as a gamepad controller on Linux OS simply by reaching a local address. You can virtually plug up to 4 gamepad controllers.

If for some reason you want to write your own, here's what you need:

  1. A phone app to detect phone inputs like the accelerometer. node-virtual-gamepads uses a web front end, you can also write a native app.
  2. A connection to your linux PC. node-virtual-gamepads uses web sockets, you can also use bluetooth.
  3. A program on your linux PC which can emulate a virtual gamepad via a kernel module. node-virtual-gamepads uses uinput with a node server.
  • \$\begingroup\$ OK! This looks like the start prequesites. I need to access the gyroscope. I guess I need some native code for that, but I don't want to bother with t&e so some papers about this would come in handy. For connection - how do you make a dynamic Bluetooth connection between mobile and laptop? In my case bluetooth would be better as I don't get a good network connection. And, lastly, what do you suggest for input gathering? All in all - thanks for input. \$\endgroup\$ – Adrians Netlis Mar 23 '17 at 16:15
  • \$\begingroup\$ Questions are free here ;) \$\endgroup\$ – congusbongus Mar 23 '17 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.