Rebinding keys with autohotkey script


So, as an Azerty user, I was pissed off to see that many keys are hardcoded. If you rebind keys in the option menu you can’t move in workshop mode, use the proper shortcut in pip-boy and many other things.

Fortunately, there is a simple solution: a autohotkey script

What’s autohotkey?
For those who don’t know, it’s a simple program that you can install on your computer and allows you to do many stuff with keyboard macros/keybinding etc… Once installed, you have to create a script file that you will launch. It will stay in background (using very low memory, 2Mb on my system) and allows you to rebind keys freely.

How to use
After installing autohotkey, you need to save this script in an .ahk file or download the file from here directly. Use notepad or notepad++ to edit it. Once you have customized the script (see customize section) and saved it, you can right click on it and select “run script”. It will go right to your tray area and stays there. You can then right click on the “H” icon to suspend, pause, exit or reload the script.

What does it do
It’s a really simple script that simply detects when Fallout 4 window is opened, and replace key press with others. By default it will make azerty keybindings (so zqsd as movement keys) available everywhere, including in workshop mod, pip-boy etc…

VERY IMPORTANT: you need to make sure that you revert the bindings to defaults in fallout 4.

How to customize
Of course you might want to customize your keybindings. Fortunately, it’s very easy to modify the script.

First let’s take a look at the script: there’s two main section. The first one is commented out (between the lines /* and */), and those are the default keybindings of fallout 4. I left them here as reference.

The second part (starting with “; Default Azerty controls”) is where the magic happens. Each line is a key bind. It’s in the form of “key you press”::”key sent to fallout” ; Comment. So if you see

z::w ; Forward

it means everytime you press the “z” key it will send “w” key to fallout. Which, with the default controls, correspond to “forward”. If you want to use another key for forward (like i for lefty using ijkl), simply replace this line with:

i::w ; Forward

and reload the script.

For “exotic” keys (numpad, F keys etc…) I invite you to take a look at the key list in the doc. If for example you want to use the key 8 on the numpad to move forward, you have to replace the above line with:

Numpad8::w ; Forward

Troubleshooting

* Make sure every time you save your script you reload it by clicking on the tray icon.
* Make sure you don’t have multiple bindings tied to the same key (if you use z::w, you can’t use z elsewhere). The script won’t launch if you do.
* Only put ONE keybindings on each line
* Everything after a “;” or between “/* ” and ” */” is a comment and will be ignored by autohotkey
* It will NOT change the prompts in the game. It will continue to say “R for transfer”, so you need to remember which key you use instead of R

Disclaimer
This script was tested on windows 7, with the game launched in borderless window. I didn’t have time to test it in other configuration, so results may vary.

If you have any questions, feel free to ask them.


Leave a Reply

Your email address will not be published.