How-To: Manually Edit keybindings.txt

You can find my semi-related guide for editing the options.txt file here: How-To: Manually Edit options.txt



Tho rare, for some people it might be necessary to have a need to manually edit keybindings.txt. This file should always be located here:

C:\Users\YOUR_USERNAME_HERE\Documents\My Games\Grim Dawn\Settings\keybindings.txt

Opening it up, you will be met with some rather cryptic looking stuff. Below I have pasted what it should look like in its initial default state.

0: 0 0
1: 46 23
2: 31 0
3: 16 0
4: 50 154
5: 28 0
6: 25 0
7: 34 0
8: 35 0
9: 2 165
10: 3 167
11: 4 168
12: 5 166
13: 6 164
14: 7 155
15: 8 156
16: 9 0
17: 10 0
18: 11 0
19: 0 0
20: 0 0
21: 145 0
22: 146 0
23: 79 0
24: 81 0
25: 80 0
26: 147 0
27: 51 0
28: 52 0
29: 18 162
30: 19 161
31: 82 0
32: 32 0
33: 38 153
34: 17 159
35: 56 118
36: 45 0
37: 44 0
38: 29 107
39: 42 163
40: 57 0
41: 14 0
42: 43 0
43: 21 160
44: 60 0
45: 61 0
46: 62 0
47: 63 0
48: 64 0
49: 65 0
50: 33 0
51: 30 0
52: 36 0
53: 47 0
54: 22 0
55: 0 0
56: 24 0
57: 0 0
58: 15 0
59: 0 0
  • The first column denotes the line number, starting with 0: and ending with 59:, for 60 lines (currently) total. In-game there are only 56 available keybindings total listed.

  • The second column denotes the Primary keybinding and will contain a number, which can range from 1 to 3 digits in size.

  • The third column denotes the Secondary keybinding and will contain a number, which can range from 1 to 3 digits in size.

  • As an example each line, or row, would appear like this: 1: 46 23

    The 1: corresponding to the line/row.
    The 46 being the Primary keybind and its value converting/equaling the C key.
    The 23 being the Secondary keybind and its value converting/equaling the I key.

    In total, this line correlates to the first keybinding listed in the options in-game, tied to the Character Window function.

  • The txt file line numbers DO NOT necessarily match the order of the Keybindings as they are listed in-game.

  • Lines 0:, 19:, 20:, and 59: have Primary and Secondary values of 0 0 and do not match or correspond with any of the keybind Functions listed in the in-game Keybinding options.

    I have no idea what these lines are intended to represent currently.

  • Lines 55: and 57: also have default Primary and Secondary values of 0 0.

    55: corresponds with the Pickup function in-game.
    57: corresponds with the Toggle Hide All Items (Loot Filter) function in-game.

  • The numbers themselves represent decimal values of DirectInput Keyboard Scancodes. Thanks go to @XandeRoot for clueing me in to that.

    Scancodes are typically represented in hexadecimal format - the codes here in this file seem to be converted from hexadecimal-to-decimal. Searching can bring to you various scancode lists. Here is one such:

    https://pastebin.com/Qy3E0qwj

    Then you will need a converter, such as:

    https://www.rapidtables.com/convert/number/hex-to-decimal.html

  • Note: I have found some instances where the decimal conversions in the file did not necessarily match up with what I have found online - particularly in the case of the gamepad codes in the file. It’s good to double check the stuff in your file by testing and checking changes.




I have put together a table below that lists the keybindings in the order they are listed in game, as well as their default bindings.

  • I have also added a column File Line that denotes the line each entry corresponds to in the keybindings.txt file.

  • Next to the Primary column I have added a File Primary column, which provides the scancode number from its line in the file.

  • Next to the Secondary column I have added a File Secondary column, which provides the scancode number from its line in the file.

File Line Function Primary File Primary Secondary File Secondary
1: Character Window C 46 I 23
2: Skill Window S 31 0
3: Codex Window Q 16 0
4: Map Window M 50 Gamepad Down 154
56: Loot Filter Window O 24 0
5: Chat Window Enter 28 0
6: Group Window P 25 0
7: Game Menu G 34 0
8: Help Window H 35 0
52: Factions Window J 36 0
53: Achievements Window V 47 0
9: Quickbar Slot 01 1 2 Gamepad A 165
10: Quickbar Slot 02 2 3 Gamepad X 167
11: Quickbar Slot 03 3 4 Gamepad Y 168
12: Quickbar Slot 04 4 5 Gamepad B 166
13: Quickbar Slot 05 5 6 Gamepad RTrigger 164
14: Quickbar Slot 06 6 7 Gamepad Left 155
15: Quickbar Slot 07 7 8 Gamepad Right 156
16: Quickbar Slot 08 8 9 0
17: Quickbar Slot 09 9 10 0
18: Quickbar Slot 10 0 11 0
21: Camera Zoom In Wheel Up 145 0
22: Camera Zoom Out Wheel Down 146 0
23: Camera Max Zoom In Num 1 79 0
24: Camera Max Zoom Out Num 3 81 0
25: Camera Default View Num 2 80 0
26: Camera Rotate Middle Mouse 147 0
27: Camera Rotate Left , 51 0
28: Camera Rotate Right . 52 0
29: Drink Energy Potion E 18 Gamepad RBumper 162
30: Drink Health Potion R 19 Gamepad LBumper 161
31: Center Map (Map Window) Num 0 82 0
32: Drop Item D 32 0
33: Personal Riftgate L 38 Gamepad Up 153
34: Switch Weapons W 17 Gamepad LThumb 159
54: Interact U 22 0
55: Pickup 0 0
35: Show Items (No Filter) Alt 56 Right Alt 118
36: Show Items Tooltips X 45 0
37: Show Items (Filter Common) Z 44 0
57: Toggle Hide All Items (Loot Filter) 0 0
38: Target Pet (Hold Key and Click) Ctrl 29 Right Ctrl 107
39: Stationary Attack (Hold Key and Click) Shift 42 Gamepad LTrigger 163
40: Pause Game (Single Player Only) Space 57 0
41: Toggle Pet Display Backspace 14 0
42: Toggle Party Display \ 43 0
43: Quickbar Switch Y 21 Gamepad RThumb 160
44: Select Pet 1 F2 60 0
45: Select Pet 2 F3 61 0
46: Select Pet 3 F4 62 0
47: Select Pet 4 F5 63 0
48: Select Pet 5 F6 64 0
49: Select All Pets F7 65 0
50: Force Move F 33 0
51: Move A 30 0
58: Push To Talk Tab 15 0



And here we have a listing of common converted scancodes you can use. Be aware that this is not an exhaustive or complete listing of all your available options. For anything not shown here you can simply use some of the listings found online (or the one linked above) and a converter (one such also linked above).

A = 30
B = 48
C = 46
D = 32
E = 18
F = 33
G = 34
H = 35
I = 23
J = 36
K = 37
L = 38
M = 50
N = 49
O = 24
P = 25
Q = 16
R = 19
S = 31
T = 20
U = 22
V = 47
W = 17
X = 45
Y = 21
Z = 44

1 = 2
2 = 3
3 = 4
4 = 5
5 = 6
6 = 7
7 = 8
8 = 9
9 = 10
0 = 11

Enter = 28
Tab = 15
Spacebar = 57
Backspace = 14
, = 51
. = 52
Back Slash = 43
Left Ctrl = 29
Right Ctrl = 107
Left Shift = 42
Right Shift = 54
Left Alt = 56
Right Alt = 118
Up Arrow = 121
Down Arrow = 126
Left Arrow = 123
Right Arrow = 124

F2 = 60
F3 = 61
F4 = 62
F5 = 63
F6 = 64
F7 = 65

Num 1 = 79
Num 2 = 80
Num 3 = 81
Num 0 = 82

Mouse Wheel Up = 145
Mouse Wheel Down = 146
Middle Mouse Click = 147

Gamepad A = 165
Gamepad B = 166
Gamepad X = 167
Gamepad Y = 168
Gamepad LTrigger = 163
Gamepad RTrigger = 164
Gamepad LBumper = 161
Gamepad RBumper = 162
Gamepad LThumb = 159
Gamepad RThumb = 160
Gamepad Up = 153
Gamepad Down = 154
Gamepad Left = 155
Gamepad Right = 156



That takes care of that and should be a handy reference to make editing this file manually easier, and much more possible. If there are any questions ask and I will try to help. Tho I certainly don’t anticipate any great need for this - the primary goal was to get the information on here for use if needed.

4 Likes

Thanks, I think I wanted it to know it at some point but now I don’t remember what for.

But maybe I could read these bindings and don’t need config entries for GDAutocaster like:

[hide items]
ingame_hide_button=Space

or

[camera]
rotation_key=k

or

[automatic camera]
rotate_left=b
rotate_right=n

I could also use more readable configs like

[combo presses]
combo1=R:_HOTBAR_SWAP,_SKILL1,_SKILL2,_SKILL3,_HOTBAR_SWAP
delay1=400

instead of

[combo presses]
combo1=r:t,1,2,3,t
delay1=400

If someone has some ideas how to use this knowledge, please share.

I don’t know if this will assist you any but I came across it while researching this stuff last night while I was floating the idea in my head of making an application to make editing the keybind file easier. I ended up trashing the concept tho as likely being more trouble than it was worth…

If anything it should be generally informative for AHK programming.

1 Like

Update:

This affects the Keybinding table in the OP.

  • Next to the Primary column I have added a File Primary column, which provides the scancode number from its line in the file.

  • Next to the Secondary column I have added a File Secondary column, which provides the scancode number from its line in the file.


Decided to do this to make referencing/cross-checking easier. Bonus from doing so is that I also discovered a line number error with one of the entries in the table and was able to rectify that.

powbam is there anyway at all to have primary+2ndary keybindings for m+K while somehow maintaining bindings for a controller?

i don’t use controller much at all so it’s not really a problem if it’s not possible, it’s just when i play with a friend (that only uses controller) i’m having troubles conveying accurate button directions trying to instruct what to do, since my default keybindings have been “tainted” by my use of primary+2ndary for m+k

I’ll be honest with you… trying to wrap my head around that made my brain hurt a little :wink: but I’m going to say… likely no. As you can see in my table above of default bindings, controller bindings generally get placed on Secondary bindings - but I can’t imagine a scenario where you can allow kbm and controller to simultaneously occupy both primary and secondary slots on a function in the game, together.


Yeah, I imagine that if you have long since changed many of the default bindings it becomes difficult to guide someone new who is likely still using the default scheme plus using a different control type.

I used to have a controller guide but that is long gone now as I put it to rest after the information became defunct when they did a considerable revamp to the way controller in GD worked.

Is there anything in particular he is having trouble figuring out how to do?

1 Like

no worries
no it’s just general beginner stuff, navigating diff “screens”, portals, assigning skills, using pots and so on.
and ofc i just swap to my controller and start pressing buttons “from back when”, but since i’ve swapped so many secondary bindings to fit M+K, it just wasn’t that helpful in telling him which buttons did what and where :sweat_smile:
we’re managing, babysteps, +if eventually he presses enough buttons enough times surely he’ll get the hang of it

1 Like

Well, I don’t know if this will help - since he could just go into keybinding options in-game and see this stuff too - but here is a condensed version of my table showing only the default controller bindings…

Function Primary Secondary
Map Window M Gamepad Down
Quickbar Slot 01 1 Gamepad A
Quickbar Slot 02 2 Gamepad X
Quickbar Slot 03 3 Gamepad Y
Quickbar Slot 04 4 Gamepad B
Quickbar Slot 05 5 Gamepad RTrigger
Quickbar Slot 06 6 Gamepad Left
Quickbar Slot 07 7 Gamepad Right
Drink Energy Potion E Gamepad RBumper
Drink Health Potion R Gamepad LBumper
Personal Riftgate L Gamepad Up
Switch Weapons W Gamepad LThumb
Stationary Attack (Hold Key and Click) Shift Gamepad LTrigger
Quickbar Switch Y Gamepad RThumb

This of course can 1) Be modified and added to in-game, and 2) doesn’t really portray the finer nuances of using a controller, such as moving the cursor around when in your inventory or how to navigate item-by-item with the d-pad while in inventory or at a merchant etc.

Plus, you can further bind buttons like Select/Back and Start - which aren’t bound to anything by default.

1 Like

ye that’s what i ended up saying too, “study” the keybind setting, and spend couple of minutes on the different screens to get used to ex selecting+assigning skills
^buut is seems like “game memory” is on goldfish level, and is forgotten every new week a session picks up :smile:

might just be i should backup my keybind txt and switch to default settings + use a controller “with him” on the playdates :thinking:

You could do that. Just make a copy of your current keybindings file and put it on the desktop perhaps and then just copy the first list in my OP above and paste it directly into the keybindings file in the Documents location listed above. This will put it back to defaults… or you can set it to defaults in the keybinding options in-game. There is a button for that screen that will do that.

1 Like

@Gnomish_Inquisition


Actually…

…I just realized that this particular statement isn’t entirely true. Both the Back/Select and Start buttons are kinda “hardbound” by the game.

  • Back/Select opens the Character Window

  • Start Pauses the game / displays the menu list

    image

So, just a heads up that trying to bind these keys to other functions may end up with conflicts and oddities.

1 Like