Autohotkey: How to map a keystroke to a controller button press

Autohotkey: How to map a keystroke to a controller button press - Crop gamer with console controller playing video game in room

I have a dualshock 4, and I know how to remap a controller button to a key, for example 'Joy2::v'. But I can't figure out how to do it the other way around. I would like to have a command like 'v::Joy2' but this just gives an error.
Any help would be appreciated.






Pictures about "Autohotkey: How to map a keystroke to a controller button press"

Autohotkey: How to map a keystroke to a controller button press - Unrecognizable gamer with VR controllers playing video game at home
Autohotkey: How to map a keystroke to a controller button press - Crop gamer with joystick playing video game at home
Autohotkey: How to map a keystroke to a controller button press - Crop gamer with joystick playing video game on sofa



How do you remap a keyboard key to a controller?

AHK has built-in capability for this. You can create hotkeys for the controller buttons and use GetKeyState for the analog inputs per the documentation on joystick keys. The Joystick Test Script from the script showcase is a good demonstration.



Automating Programs with Controls in AutoHotkey: 07 ControlClick




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Eren Li, Eren Li, Eren Li, Eren Li