Giter Club home page Giter Club logo

gamepad's Introduction

Gamepad

Gamepad

.Net Core based library, that allows getting the button presses and axis value changes of a gamepad or a Joystick.

The library was developed with Raspberry Pi in mind (but probably runs on any linux based device)

This is all you need to do to use it:

// You should provide the gamepad file you want to connect to. /dev/input/js0 is the default
using (var gamepad = new GamepadController("/dev/input/js0")) 
{
    // Configure this if you want to get events when the state of a button changes
    gamepad.ButtonChanged += (object sender, ButtonEventArgs e) =>
    {
        Console.WriteLine($"Button {e.Button} Pressed: {e.Pressed}");
    };

    // Configure this if you want to get events when the state of an axis changes
    gamepad.AxisChanged += (object sender, AxisEventArgs e) =>
    {
        Console.WriteLine($"Axis {e.Axis} Pressed: {e.Value}");
    };

    Console.ReadLine();
}
// Remember to Dispose the GamepadController, so it can finish the Task that listens for changes in the gamepad

If you are feeling generous and want to support this project, you could buy me a beer to energyze my programming nights using the button below.

paypal

Not to much please, I don't want to get drunk either!

gamepad's People

Contributors

nahueltaibo avatar vertigra avatar knopfm 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.