This python project is a simple wrapper ontop of ViGemBus driver that allows HID emulation on Windows machines to emulate an XBOX360 controller and manipulate it via keyboard and mouse. Created for people that don't enjoy the idea of spending money on a gamepad to play certain games as well as for those who never had one and never wanted one in their possession. Project was initially written years ago when I decided to play a very known game that only supports controller inputs and been rewritten to fix some major issues like input lag (thanks python), flexibility in customization and lack of some quality-of-life features like cursor hiding.
| Prerequisite | Description |
|---|---|
| Windows | Operating System |
| Python 3.12 | Interpreter, tested only on 3.12 |
| ViGemBus driver | Installed with requirements.txt |
| Keyboard and mouse | Obviously, right? |
Step 1: Clone the project by either using git cli
git clone [email protected]:aASDa213ASD/WGE.gitor by downloading the source code directly
Step 2: Create virtual environment
cd WGE
python -m venv .envStep 3: Activate virtual environment you've just created
.env\Scripts\activateStep 3: Install prerequisites, that will install ViGemBus driver as well
pip install -r requirements.txtAll of the tinkering with your binds and gamepad button definitions will be happening in setting.py file. I've spent some time writing this all down so you've got a decent chance to understand what goes where and why. In this file you are able to edit your sensitivity, keybinds, mousebinds and invert direction of any axis as well as redefine the maximum possible stick position.
Either run gamepad.bat and it will activate virtual environment and launch the project for you, all you are left to do is to press your pause bind to unpase the gamepad and perhaps press your calibration bind to set the origin of right stick to current cursor position.
That's pretty much it, now you can point your gamepad to some program and use it as it was real.
Attention: In case you've created virtual environment with other name than .env change it in .bat file as well.
@Nefarius for his ViGEmBus that allowed all of that to be crafted in the first place
@yannbouteiller for vgamepad python package on pypi that handles some dirty job talking to ViGemBus through python means
@PRich57 for showing a good example of how one can hide a cursor on Windows system via user32.dll only