• DCEmu Homebrew Emulation & Theme Park News

    The DCEmu the Homebrew Gaming and Theme Park Network is your best site to find Hacking, Emulation, Homebrew and for the first time Theme Park News. If you would like us to do reviews or wish to advertise/write/post articles in any way at DCEmu then use our Contact Page for more information. DCEMU Gaming is mainly about video games - if you're interested in iGaming and casino sites, please visit newcasinosites2018.co.uk. They have all new casinos for 2018.
  • Headline News

    Check out the latest additions to the DCEmu Network, for Alcohol fans theirs Wraggys Beers Wines & Spirits Reviews, for fans of Theme Parks and News and Videos we have DCEmu Theme Park News, finally we have Gamer Wraggy 210 who plays games for the first time.
  • node.js for Linux joysticks

    [Tim Caswell] has been using gamepads and joysticks to demonstrate his node.js hacks for a long time. The thing is, he has been relying on C++ bindings to handle the hardware while trying to herald the praises of node.js. Why not cut out the middle man and write a joystick driver in node.js? It turns out to be so simple anyone can do it.
    Granted, this is not a kernel driver. Heís relying on the Linux kernel to recognize the hardware and provide him with the customary /dev/js0 file which he can then work with. As you can see in the snippet above, heís looping through code in order to constantly read from the hardware. To get this far he dug through the documentation for joystick packets (yay for open source!) to find that each is made of a 32-bit timestamp, a 16-bit value, and two 8-bit numbers identifying the event type and button or axis.
    Once he has the packets, itís off to the races. Each data type is parsed into an appropriate variable which you can use in the logic of your own program. Donít be nervous, this will make a great weekend project!

    http://hackaday.com/2012/08/04/node-...nux-joysticks/
    This article was originally published in forum thread: node.js for Linux joysticks started by wraggster View original post
  • News Categories