I just spent an hour trying to figure this out and there doesn't seem to be much info on it, so I figured I'd write something down to make it useful to others.
In the latest/last patch, mods now get access to 4 hotkeys.
In the source code, these are defined in DLLInterface.h as
Code:
INPUT_REQUEST_MOD_GAME_COMMAND_1_AT_POSITION
Code:
INPUT_REQUEST_MOD_GAME_COMMAND_2_AT_POSITION
Code:
INPUT_REQUEST_MOD_GAME_COMMAND_3_AT_POSITION
Code:
INPUT_REQUEST_MOD_GAME_COMMAND_4_AT_POSITION
However, you also need to enable them within the game. To do this you need to add a
Code:
GAMECONSTANTS_Mod.XML
Code:
<CNCEnableModHotKeyGameCommands network="client"> True </CNCEnableModHotKeyGameCommands>
Here's the entirity of the file, you can just copy/paste this if it's easier:
Code:
<?xml version="1.0"?>
<GameConstants>
<GameConstantsClass>
<!-- MBL 09.08.2020: Community-requested Mod option so that players can have customized mod hotkey commands -->
<!-- If True, also need to set GAME_COMMAND_CNC_MOD_COMMAND_1 -> GAME_COMMAND_CNC_MOD_COMMAND_4 entries in InputTranslatorConfigurations.xml -->
<CNCEnableModHotKeyGameCommands network="client"> True </CNCEnableModHotKeyGameCommands> <!-- Default is always False -->
</GameConstantsClass>
</GameConstants>
<GameConstants>
<GameConstantsClass>
<!-- MBL 09.08.2020: Community-requested Mod option so that players can have customized mod hotkey commands -->
<!-- If True, also need to set GAME_COMMAND_CNC_MOD_COMMAND_1 -> GAME_COMMAND_CNC_MOD_COMMAND_4 entries in InputTranslatorConfigurations.xml -->
<CNCEnableModHotKeyGameCommands network="client"> True </CNCEnableModHotKeyGameCommands> <!-- Default is always False -->
</GameConstantsClass>
</GameConstants>
It's worth notinbg that I don't think you have to set the entries in InputTranslatorConfigurations.xml if you just want to bind some commands in the bindings screen, they'll be sent through as INPUT_REQUEST_MOD_GAME_COMMAND_x_AT_POSITION.
Doing this enables them in the bindings screen:

I haven't figured out if there's a way to rename them from Mod Command x to something more specific.
That's about it really.