0

I wrote a simple AHK script to remap keyboard keys for classic DOOM. The native keybindings uses the up and down arrow to move forward and back, left and right to rotate left and right, and then alt+left or alt+right to strafe left or right without turning

i wanted to rebind movements to WASD, but change the behavior of A and D so they would strafe (Alt+left) instead of turn (left), and then binging rotation to different keys on my numpad

With the following script, pressing A or D simply rotates (meaning it is sending Left/Right, not Alt+Left/Alt+Right)

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#IfWinActive, DOSBox SVN

#SingleInstance Force
#installKeybdHook
#Persistent
Menu, Tray, Icon , Shell32.dll, 25, 1
TrayTip, AutoHotKey, Started, 1
Return

w::up
s::down
a::!left
d::!right
Numpad0::Ctrl

Numpad1::left
Numpad3::right

With this version, it doesn't seem to receive an input at all from A and D. all the other key bindings work as expected

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#IfWinActive, DOSBox SVN

#SingleInstance Force
#installKeybdHook
#Persistent
Menu, Tray, Icon , Shell32.dll, 25, 1
TrayTip, AutoHotKey, Started, 1
Return

w::up
s::down
a::
send, !{left}
return
d::
send, !{right}
return
Numpad0::Ctrl

Numpad1::left
Numpad3::right

any help would be appreciated

echocosm
  • 33
  • 2
  • Try adding [#UseHook](https://www.autohotkey.com/docs/v1/lib/_UseHook.htm) on top and read [this](https://www.autohotkey.com/docs/v1/FAQ.htm#games). – user3419297 Aug 04 '23 at 10:22

0 Answers0