A Windows application for modifying PS5 DualSense controller input using Lua scripts. Create custom controller behaviors like anti-recoil, auto-sprint, aim assist, and more.
For offline/single-player games only.
- DualSense Support - Full PS5 controller input reading via USB or Bluetooth
- Virtual Controller - Outputs to a virtual Xbox 360 controller that games recognize
- Lua Scripting - Write custom scripts to modify controller input in real-time
- Live Preview - See input and output values side-by-side in the GUI
- Hot Reload - Refresh scripts without restarting the application
- Per-Game Profiles - Save different script configurations for each game
- Weapon Presets - Per-gun recoil patterns with customizable settings
- Global Hotkeys - Toggle scripts and switch weapons with keyboard shortcuts
- On-Screen Overlay - See active scripts and weapon info while gaming
- Windows 10/11 (64-bit)
- PS5 DualSense controller
- ViGEmBus Driver (required for virtual controller)
- Visual Studio 2022 with C++ workload (for building)
git clone https://github.com/Atomicstorme/controller_scripts.git
cd controller_scriptsRun setup_dependencies.bat to create the folder structure, then download:
| Dependency | Source | Destination |
|---|---|---|
| Dear ImGui | GitHub | libs/imgui/ |
| HIDAPI | GitHub | libs/hidapi/ |
| ViGEmClient | GitHub | libs/ViGEmClient/ |
| Lua 5.4 | lua.org | libs/lua-src/ |
See SETUP.txt for detailed instructions.
- Open the folder in Visual Studio 2022
- Select a kit (e.g., "Visual Studio Community 2022 Release - amd64")
- Build -> Build All
Or via command line:
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64
cmake --build . --config Release- Install the ViGEmBus driver (one-time)
- Connect your PS5 DualSense controller
- Run
PS5ControllerScripts.exe - Enable scripts by checking the checkbox next to them
- Play your game - it will see the virtual Xbox controller with modified input
Create different profiles for each game with unique script settings:
- Click the + button next to the profile dropdown
- Enter a profile name (e.g., "Call of Duty", "Apex Legends")
- Configure scripts and weapon presets for that profile
- Switch between profiles using the dropdown
Settings are automatically saved and restored when you switch profiles.
Create per-gun recoil patterns within each profile:
- Expand the Weapon Presets section
- Click + to add a new weapon (e.g., "AK-47", "M4A1")
- Adjust settings for that weapon:
- ADS Strength - Anti-recoil when aiming down sights
- Hip-Fire Strength - Anti-recoil when hip-firing
- Horizontal - Horizontal recoil compensation
- Smoothing - Movement smoothing (0 = instant, 1 = smooth)
- Set a Hotkey to quickly switch to that weapon in-game
Click the hotkey button next to any script (shows "..." or current key) to assign a toggle hotkey.
In the Weapon Presets section, click the hotkey button to assign a key for instant weapon switching.
Press F12 to show/hide the on-screen overlay.
- Click the hotkey button
- Press your desired key (with optional Ctrl/Alt/Shift modifiers)
- Press Escape to cancel, Delete to clear
The overlay displays real-time status while gaming:
- Controller connection status
- Active weapon and settings
- Enabled scripts
- Configured hotkeys
Configure in File > Settings > Overlay:
- Show/Hide - Toggle overlay visibility
- Position - Choose corner (Top-Left, Top-Right, Bottom-Left, Bottom-Right)
- Opacity - Adjust transparency
The overlay works over borderless/windowed games. Press F12 to toggle.
| Script | Description |
|---|---|
anti_recoil.lua |
Automatically compensates for weapon recoil when firing |
auto_sprint.lua |
Auto-sprint when pushing the left stick forward |
aim_assist.lua |
Slows aim movement when ADS for precision |
rapid_fire.lua |
Rapid fire for semi-automatic weapons |
deadzone.lua |
Adjustable stick deadzones |
Create a .lua file in the scripts/ folder. Scripts must have a process function:
function process(input)
local output = input
-- Example: Invert Y axis
output.left_y = -input.left_y
return output
end| Field | Type | Range | Description |
|---|---|---|---|
left_x, left_y |
float | -1.0 to 1.0 | Left stick |
right_x, right_y |
float | -1.0 to 1.0 | Right stick |
left_trigger, right_trigger |
float | 0.0 to 1.0 | L2/R2 triggers |
cross, circle, square, triangle |
bool | Face buttons | |
l1, r1, l3, r3 |
bool | Shoulder/stick buttons | |
dpad |
int | 0-8 | D-pad (0=up, 2=right, 4=down, 6=left, 8=released) |
dt |
float | Delta time in seconds |
clamp(value, min, max) -- Clamp value between min and max
lerp(a, b, t) -- Linear interpolation
deadzone(value, zone) -- Apply deadzone to stick value
get_param(name, default) -- Get script parameter
print(...) -- Debug outputSee scripts/_template.lua for a complete reference.
To distribute the application, package these files:
PS5ControllerScripts.exehidapi.dllscripts/folder
Users only need to install the ViGEmBus driver.
This project is licensed under the Open Software License 3.0.
- Dear ImGui - Immediate mode GUI
- HIDAPI - HID device communication
- ViGEmBus - Virtual gamepad emulation
- Lua - Scripting language
This software is intended for use with offline/single-player games only. Using input modification in online multiplayer games may violate terms of service and result in bans. Use responsibly.