tajni wrote: ↑11 Apr 2021, 00:45
Hello.
I want to remap alt key for shift and vice versa. I stumbled upon a code on reddit but I cannot seem to get it to work but it would be exactly what I need. Just swap shift for alt and alt for shift inside the dota 2 client and not outside.
Code: Select all
SetTitleMatchMode , 2 ; exact matching, maybe unnecessary but idgaf
#IfWinActive , ahk_class Valve001 ; current ahk_class for Dota 2 window
LShift::LAlt
LAlt::Shift
What is ahk_class?
And is the rest of this right?
The
ahk_class of a window is one way to identify a certain window (class), in order to create window-specific code.
You can determine the
ahk_class of a target window by using the
Window Spy script included with AHK.
The code above looks like it could work - if the
ahk_class is correct. (Currently it is remapping the left shift key to the left alt key, and the left alt key to shift generally).
You could start by temporarily removing the line
#IfWinActive , ahk_class Valve001 and see if the remappings generally work in the game - if yes, add the line again, ideally after checking if the
ahk_class is correct.
(Sorry, I can't check for you, since I don't have the game - never even played it.)