Code Monkey home page Code Monkey logo

xinputium's Introduction

NuGet .NET Version License

XInputium Logo

XInputium is a .NET library that provides you out-of-the-box XInput integration into your application. In contrast with other existing .NET XInput libraries, XInputium introduces a full-fledged input system, and is designed to allow you to focus more on your game/application logic and less on input handling code.

Key features

  • A dedicated Event System, composed of dynamic events (events that are triggered accordingly to your custom specific conditions), as well as the regular .NET events.
  • Built-in input loop — you don't need to worry about managing input state logic between application/game frames. Just call a single method each frame, and XInputium will do the rest.
  • Built-in Joystick and Trigger functionality, like dead-zones, axis inversion, smoothing, sensitivity and many more.
  • Axis Modifier Functions allow you to modify axes in any way you wish. Several built-in functions included, which you can creatively combine to do whatever your game or application requires.
  • Map joysticks or triggers to buttons, using your own mapping criteria.
  • Compose layers of joysticks/triggers for specific parts of your application. For instance, the same joystick might have different simultaneous configurations depending on the current game/application mode the user is at.
  • XAML bindable — bind your XAML controls to any property (ex. joystick radius), and it just works.

For a more exhaustive description about XInputium and its features, refer to the Introduction page on the Wiki.

Installation

You can install XInputium on your project using its NuGet package.

Install-Package XInputium -Version 1.2.0

Getting started

The following example code shows how you can consume XInputium:

XGamepad gamepad = new();
gamepad.ButtonPressed += (s, e) => Debug.WriteLine($"Button {e.Button} was pressed.");

// Call this on every app/game frame.
gamepad.Update();

XGamepad represents a logical controller device, and is the main class you would use to consume most of XInputium's features. The only thing you need to do is to update the device state on every app/game frame, as shown in the previous example. Once you call gamepad.Update(), any consequent events will trigger.

XInputium is fully documented, and essential information in the remarks sections is included wherever necessary. The API is designed to be as easy to use as possible, while still providing powerful features.

See the Getting started page on the wiki for more information on how to get up and running with XInputium.

System requirements

  • XInputium is built on .NET 6.0.
  • XInputium uses XInput 9.1.0 API.
  • Currently, only Windows 7 or later is supported.

Demo application — XInputium Preview

The provided XInputium demo application — XInputium Preview — lets you see XInputium in action and allows you to test-drive some of its features. It is a WPF application, made mostly in XAML, that shows how you would use XInputium in your own applications or games. XInputium Preview can also be useful to diagnose your XInput compatible device.

XInputium Preview — XInputium feature preview application

XInputium Preview offers an easy way for fine-tunning gamepad settings to use on your own applications. Also, feel free to take a look at its source code, and have a glimpse on how to use XInputium within a working application.

xinputium's People

Contributors

aderitosilva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.