Donitzo / pulsekey

A customizable Game Controller to Keyboard/Mouse mapper with Analog to Pulse-Width Modulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

## Warning!

PulseKey utilizes the SendInput Win32 API for simulating keyboard and mouse actions. This method of emulation is commonly found in software designed for cheating in video games, such as aimbots for Counter Strike. Consequently, it may be detected by anti-cheat technologies. It is advisable to not use PulseKey with any software that employs anti-cheat measures to avoid the risk of being banned.

PulseKey

PulseKey

PulseKey is a tool designed to map game controller inputs to keyboard and mouse commands, featuring Analog to Pulse-Width Modulation conversion. The initial motivation for creating PulseKey was to enable the use of a game controller for playing System Shock 2, which led to the tool's evolution into a more general program.

A key focus during PulseKey's development was exploring the feasibility of replicating analog input behaviors on keyboards through Pulse-Width Modulation. The findings indicate that it sometimes work.

Note: Keep the PulseKey window on the correct monitor if using v-sync.

Playing System Shock 2

Download

To access the latest version, navigate to the Actions tab on GitHub, select the most recent build, and download the build artifacts from there.

Pulse-width modulation

Pulse-width modulation (PWM) is a technique for encoding a signal into a square wave, essentially transforming it into a binary form. This method allows for the conversion of an analog signal, like the one generated by the movement of a game controller stick, into distinct pulses.

At rest, with the controller stick in its neutral position, the signal has a 0% duty cycle, meaning it remains low and inactive. As the stick moves away from its center towards any direction, the duty cycle adjusts accordingly—reaching 50% when the stick is halfway to its maximum extension, resulting in the signal being high for half of the time. This translates to the corresponding keys being activated on every alternate system tick. For a duty cycle set at 10%, the keys would be pressed once every ten ticks.

The duty cycle thus serves as a digital representation of the analog input's intensity, where the total duration of the "high" state directly correlates to the extent the key is engaged.

Duty Cycle

Third-party libraries

  • SDL2: PulseKey leverages SDL2 for its extensive game controller support and OpenGL rendering capabilities. SDL2 is distributed under the zlib license.
  • ImGui: Utilized for its extremely lightweight graphical user interface, ImGui is compatible with various rendering backends, including SDL2. Licensed under the MIT license.
  • yaml-cpp: This library is employed for reading game configurations from a YAML file. yaml-cpp is also under the MIT license

Game configurations

Game settings are specified within a games.yaml file. Contributions to the game configurations are welcome; if you devise a well-functioning setup for a game, please consider submitting it via an issue on GitHub for potential inclusion in the default configuration list.

Building the project

PulseKey's builds are automated for Windows through GitHub Actions, using the vcpkg package manager and CMake for building. The build process is using MinGW with G++, and due to the reliance on Windows-specific APIs, porting the project to Linux or macOS would require significant modifications.

Feedback & Bug Reports

If you find any bugs or have feedback, please open an issue in the GitHub repository.

About

A customizable Game Controller to Keyboard/Mouse mapper with Analog to Pulse-Width Modulation

License:MIT License


Languages

Language:C++ 95.0%Language:CMake 5.0%