thisismypassport / myinput

Maps keyboard keys to a virtual gamepad on a per-app basis, without having to install drivers.
MIT License
7 stars 0 forks source link
controller directinput gamepad joystick keyboard remapping xbox360-controller xinput

myinput

Allows mapping Keyboard/Mouse keys to a Virtual Controller on a per-app basis, without having to install any drivers.

Can also remap Keyboard/Mouse keys to other Keyboard/Mouse keys.

Currently not user-friendly, but functional.

You can find the latest release (MyInput_Windows.zip) here.

If you find this useful, and have any requests or suggestions, let me know via opening an issue or starting a disussion. (And if you're having trouble getting it to work on your machine or to behave as you'd like, please open an issue)

Usage

You can run myinput.exe to open a window, from which you can:

One-time Run

To run an executable under myinput just once, click on "Launch New (One-Time)" on the bottom right of the myinput window.

Alternatively, in Windows Explorer, just drag the executable you want to run to x64\myinput_inject.exe

Register to Always Run

To register an executable so that - whenever you launch it - it is launched through my input, click on "Register New" (near the bottom right of the myinput window).

Alternatively, in Windows Explorer, just drag the executable you want to register to x64\myinput_register.exe (you can drag it again to unregister it)

Note: Registering an executable requires admin permissions (as it uses Image File Execution Options to change how the executable runs).

Mapping Configuration

The configuration file specify which keys map to which keys/buttons.

You can open the global configuration file by clicking "Edit Global Config" (or opening Configs_default.ini directly).

Default Configuration File

By default, it maps keyboard keys to a XBox360 controller.

The lines at the top of the file (that start with a '#') are comments that describe the configuration format, whereas the lines below map keys to various buttons.

For example: (these are all parts of the default configuration)

Note that lines that start with "#" are ignored.

Advanced Configuration Examples

You can see more advanced examples in Config\myinput_test.ini

(Do not copy the #[ and #] line - they cause the whole block to be ignored)

For example: (these are NOT parts of the default configuration, just examples of what you can do)

Per-Executable Configuration

You can specify a configuration for each executable, by either:

Building from Source

Prerequisite: https://github.com/microsoft/Detours - copy to 3rdparty/detours folder

Then just build with MSVC 2022 or above.

Implementation Details

It hooks: