Coder Social home page Coder Social logo

ds4lib's Introduction

DS4Lib 1.0

Introduction

This is a simple Linux library written to control the Dualshock 4 through USB.

This library reads the data from a temporal file created in /dev/input/ when you plug in the DS4.

Functions

All functions are in ds4.h.

Include this file to your proyect to be able to use DS4Lib.

Functions:

  • DS4_CONTROLLER * ini_DS4();

  • int free_DS4(DS4_CONTROLLER * ds4);

  • int button_pressed(DS4_CONTROLLER * ds4, int Button);

  • int ds4_update_status(DS4_CONTROLLER * ds4, char * data);

  • int ds4_print_status(DS4_CONTROLLER * ds4);

  • int ds4_get_joyL_hor(DS4_CONTROLLER * ds4);

  • int ds4_get_joyL_ver(DS4_CONTROLLER * ds4);

  • int ds4_get_joyR_hor(DS4_CONTROLLER * ds4);

  • int ds4_get_joyR_ver(DS4_CONTROLLER * ds4);

  • int ds4_get_tpad_coord(DS4_CONTROLLER * ds4);*

This version

DS4Lib 1.0 adds touchpad tracking. You can get the status of the new pressable buttons (TPAD_CLICK, TPAD_TOUCH) declared in buttons with the usual button_pressed() function. You can also retrieve the coordinates of your finger on the touchpad with the new 'ds4_get_tpad_coord(DS4_CONTROLLER * ds4)' function.

Touchpad-coordinates: (adjust at your will. Take into account touchpad, dimensions (52mmx23mm (external approximately))[source: http://www.psdevwiki.com/ps4/DualShock_4];

      x-axis         

0_ _ _ _ _ _ _ _ _ _ _ _255

y|_ _ _ _ _ _ _ _ _ _ _|

-|_ _ _ _ _ _ _ _ _ _ _|

a|_ _ _ _ _ _ _ _ _ _ _|

x|_ _ _ _ _ _ _ _ _ _ _|

i|_ _ _ _ _ _ _ _ _ _ _|

s|_ _ _ _ _ _ _ _ _ _ _|

255_ _ _ _ _ _ _ _ _ _ _ _

In future versions DS4Lib will include tracking of gyroscope/accelerometer values in real time.

Changelog

DS4Lib 1.0: Adds Touchpad tracking

DS4Lib 0.9: Adds Joystick tracking.

  • Tracking of all buttons and Joysticks.

DS4Lib 0.5: Initial release.

  • Tracking of all buttons.

Contributors

j0lama: Buttons and Joysticks tracking.

s0cKrate5: TouchPAD tracking.

ds4lib's People

Contributors

j0lama avatar s0ckr4te5 avatar

Watchers

 avatar

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.