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
A high level code diagram of the XMapLib project code (native C++)
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 :
- MouseMapper
- KeyboardMapper
- MousePlayerInfo
- KeyboardPlayerInfo
- To set the mapping details KeyboardKeyMap encapsulates the information comprising a controller key to keyboard/mouse key mapping.
Also, please see the Example
The DLL API exposed from XMapLibDLL is described totally in apifuncs.h in the DLL project.
Windows and Visual Studio 2022 are required. Open XMapLib.sln and build the solution:
XMapLib/is the native C++ library.XMapLibDLL/wraps it as a DLL.XMapLibSharp/is the C# .NET GUI that uses the DLL.XMapLibTest/holds the native unit tests (run from Visual Studio's Test Explorer).
Related repositories: PolarCode, xmaplib_keyboard.
MIT, see LICENSE.txt.


