Skip to content

A closer to the metal library for Xbox controller to keyboard and mouse input.

License

Notifications You must be signed in to change notification settings

calebtt/XMapLib

Repository files navigation

XMapLib

MSBuild

A closer to the metal library for Xbox controller to keyboard and mouse input simulation on Windows

Current Features

  • Mapping of controller input to keyboard and mouse input on Windows.
  • GUI for changing key bindings
  • List of key binding presets to choose from
  • Editable list of key bindings
  • Adjustable mouse sensitivity
  • Toggleable key repeat behavior

Roadmap

  • Lower CPU usage
  • Portable input simulation thread priorities
  • Dep. injected timestamp retrieval, system calls for high res. clock are heavy
  • Make use of polar coordinates instead of scaling cartesian coordinates (PolarCode repo)

Possible Ideas

  • Integrate my PolarCode repo code
  • Portable everything
  • Run as a system service instead of on-demand app
  • Load/Save config files and share them

XMapLibSharp is a C# .NET GUI project using the C++ project code through a DLL. With this approach, the project has access to the entire .NET framework for GUI work while keeping the native performance and power of the C++ XMapLib project code.

The project utilizes

  • .NET multi-threading
  • events
  • programmatic UI element creation
  • a producer/consumer design pattern.
  • managed/native interop via custom C++ DLL

XMap-Lib-gui2 XMap-Lib-gui3

A high level code diagram of the XMapLib project code (native C++) XMapLib-uml

The project utilizes

  • C++ templates
  • Template SFINAE
  • constexpr
  • unit testing with Microsoft CppUnitTestingFramework
  • multi-threading, many threads running concurrently and interacting
  • concurrency synchronization objects, like mutexes and RAII scoped locks
  • C++ standard atomics
  • lambdas, and passing lambdas as arguments
  • usage of several Windows API functions including the XInput lib
  • operator overloads
  • input simulation
  • C++ pointer wrappers like unique_ptr
  • if-constexpr to do compile-time decisions instead of run-time
  • STL containers and algorithms
  • it is a real time system (or very close)
  • lots and lots of object oriented programming

The main classes for use in the native C++ XMapLib project are :

Also, please see the Example

The DLL API exposed from XMapLibDLL is described totally in apifuncs.h in the DLL project.