Possible Keybindings (not exhaustive!):
Keyboard Keybinds:
Note: All single keys must be CAPITALIZED.
Single Keys
e.g. Z, T, G, B, etc.
Key Modifiers + Single Keys
e.g. Shift-1, Shift-2, Alt-1, Ctrl-1, etc.
Multiple Key Modifiers + Single Keys
Order of modifiers is important - use them in this order: Shift, Ctrl, Alt.
e.g. Shift-Ctrl-1, Shift-Alt-B, Ctrl-Alt-T, Shift-Ctrl-Alt-H
Numpad
Note the capitalization of NumPad.
e.g. NumPad0, NumPad1 to NumPad9, NumPad*, NumPad+, NumPad-, etc.
Special Keys:
e.g. R Ctrl (with a space), R Alt, PgUp, PgDn, Home, End, ScrlLock, NumLock, Backspace, Insert, Delete, Caps Lock
Mouse Keybinds:
Mouse1
Mouse2
Mouse3
Mouse4/5/6/7/8
MouseWheelUp
MouseWheelDown
Controller Keybinds:
Xenon_A / Xenon_B / Xenon_X / Xenon_Y
Xenon_Select / Xenon_Start
Xenon_LS / Xenon_L1 / Xenon_L2 / Xenon_L3
Xenon_RS / Xenon_R1 / Xenon_R2 / Xenon_R3
DPad_Up / DPad_Down / DPad_Left / DPad_Right
To use hotkeys on Xbox 360 controllers without overriding a default action, you can map the Xbox Guide button to the Shift key with JoyToKey, and prefix your controller keybinds with Shift-<keybind> (e.g. Shift-DPad_Up). You can then access hotkeys by pressing the Xbox Guide button + your assigned button.
139 comments
If you are trying to put some if/elseif/endif or other conditional command in the bat that's going to not work or at least will need different formatting from what will run without problems directly in the console. For unknown reasons it just doesn't fly even if your lines are literally identical between bat and direct ingame console command. The "different formatting" part is just my wishful thinking, it might just not work period.
But you can put console commands directly in hotkeys.ini if you skip RETURN/linefeed/newline between the commands you wish to bind to one key/combination. Use ; to separate commands.
Very useful to use this toggle command, when I use "player.unequipall" console command to see if any armor mods are causing VFX glitches on my player character.
in case you don't understand what Daniel said, above, take the pip-boy unequip line...
you type it in the console, it will toggle wearing it or not, depending on the checked getequipped status. you put that in a text file and call with 'bat togglepipboy' and you get thrown "Mismatched if/else/endif block starting on line 1" even though it's clearly not mismatched and working fine.
so while you can do pretty long if;elseif;elseif;else;endif conditionals, you're limited to a single line without calling an external file, which really hampers detailed logic structures... say you want a key mapped for firing off 8 chems if you have them, check if each chem is already active so you don't take more of the same, check for each chem addiction and drink a refreshing beverage or take addictol if true, check if you're on survival and drink # waters to compensate for increased thirst, etc.
as far as we know, it can't be done. Well, what I mean is, it probably CAN be done, we just don't know how to yet, without being able to call external files. I've tried the macro function too, but when your single line is 3850 characters, with 3 dozen compounded elseifs, it does not seem to work that way either.
would love this to work one day, so people interested in macros but not necessarily the learning curve of CK to make their own mod, could come up with some really elaborate and clever and functional hotkey scripting... but it is what it is.
I tried (i have "use" in F):
N=R;F with and without the quotations and i changed " ; " for " , "
using this to throw a grenade but I can't get anything to work.
L Ctrl=player.pa ActionThrow
Nevermind, got it to all work with steam overlay and Buffout 4.
how do I undo it
Edit: I think I've found a fix.. I maybe just need to edit the keys inside CustomControlMap.txt
Edit 2: yepp it work!
Fallout 4 console commands | Fallout Wiki | Fandom
It won't work in hotkeys, as all commands on the line are executed regardless of preceding conditional logic.
if GetItemCount "59a71"; show gamehour
Will always show the game time whether you have any abraxo or not.
It won't work in bat files, as the line containing logic statements always causes a "mismatched if/then/else block" error despite using syntax that works correctly when simply pasted/executed in console.
if getini "bGamepadEnable:GENERAL"==1; setini "bGamepadEnable:GENERAL" 0; elseif getini "bGamepadEnable:GENERAL"==0; setini "bGamepadEnable:GENERAL" 1; endif
So it's possible to create toggles based on info that can be brought up in console.
I don't know about the getitemcount thing. What you pasted is malformed but I assume you've tried it with proper closing endif.
The following hotkey command will create a gasmask toggle bound to the Z key:
Z=if "14".getEquipped 000787d8; "14".unequipItem 000787d8; else; "14".equipItem 000787d8; endIf
In speaking terms, this command is basically saying: "if a gasmask is equipped, unequip it. otherwise, equip one". You can then copy and paste this into other hotkeys, simply replacing the "000787d8" with whatever form ID you want to create a toggle for and replacing the Z at the beginning of the line with whichever key you want to bind to.
If you're like me and get annoyed by notifications about equipping items, the following hotkey will do the exact same thing as above, but will not create a notification in your upper-left corner when an item is equipped/unequipped.
Z=if "14".getEquipped 000787d8; "14".cf unequipItem 000787d8 0 1; else; "14".cf equipItem 000787d8 0 1; endif
This command does not use the getItemCount function (I haven't tested but other users say it doesn't work? but I don't think that's correct). The getItemCount is only to test if the player actually has the item in their inventory. Running the above hotkey without a gasmask in your inventory will just add one to your inventory. But I also just don't add a toggle hotkey for items I don't already own?
If that's not good enough for you, the below command should theoretically work as well, but I haven't tested.
Z=if "14".getItemCount 000787d8; if "14".getEquipped 000787d8; "14".unequipItem 000787d8; else; "14".equipItem 000787d8; endIf; endIf
Take special note of the quotation marks around the ID here - they are required around baseIDs when using conditional statements in the console.