Remapping Alt Key to Space bar and Using Profiles
So in DOTA 2 I would like to use space bar a key modifier, like ALT does. so I remapped the ALT key to Space Bar and vice versa using AutoHotkey. The problem is, when I am chatting to my team mates, I have to use the ALT key as a space. Is there a way to make it so that I could use say Num1 and Num2 (any key is fine, I have rebindable keys on my keyboard), to switch between the remapped version of my keys and the original usage of the keys, like a profile system?
Edit: Changed wording for clarification.
Best Answer
This is an old question but because I got an answer I thought I could share it.
I think this is exactly what I did for myself https://github.com/bemug/dota2cfg
The good news is that it can be done right in source scripting, you don't need external tools.
Basically I remap the space key to a modifier using source script, and when I press space, it execute a file containing some bindings. When I release it, it execute another file overriding these bindings with new ones.
alias +keyShift "exec bindingsOnPress"
alias -keyShift "exec bindingsOnRelease"
bind "SPACE" "+keyShift"
Hope this helps :)
Pictures about "Remapping Alt Key to Space bar and Using Profiles"



How to use Alt key as spacebar?
You should get a space symbol if you type Alt+32 and then release it.Is there another way to use the spacebar?
You could add a second additional Space Bar on the Right Ctrl key, as another option (you can have as many as you like), or you could use both Ctrl keys as Space Bars and make the SpaceBar a Ctrl key.How to Enter space without space button?
Thus typing Alt+32 and then releasing the Alt, should give you a space symbol.How do you make spaces on your keyboard?
How to make a non-breaking space on the keyboardTech Tuesday - How To Remap Keys [No Third Party Software]
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Andrea Piacquadio, Andrea Piacquadio, Andrea Piacquadio, Anete Lusina
