Howw to configure controls?

mara5a

Chieftain
Joined
Mar 12, 2013
Messages
20
Hi, the title is pretty self-explanatory. Is there a way how to configure some of the controls? f.e. set secondary button for ending turns to middle mouse etc.
 
Pardon the necromancy here, but has anyone noticed some way (including mods) to configure controls/hotkeys since this thread was posted?
 
Most of them, or maybe all of them, are defined in the XML. You could change them by making a mod and reassigning the ones you want to change. Not exactly a "pop up a screen and pick your shortcuts" type thing as that does not appear to be possible since there is no Python to set a hot key for anything, only get the one assigned.

Example: Look at CIV4ControlInfos.xml in Assets/XML/Units under wherever you installed the game. In that file there is a section that looks like this:
Code:
		<ControlInfo>
			<Type>CONTROL_ENDTURN</Type>
			<Description>TXT_KEY_ACTION_ENDTURN</Description>
			<Help>TXT_KEY_ACTION_ENDTURN_HELP</Help>
			<HotKey>KB_RETURN</HotKey>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>1</iHotKeyPriority>
			<HotKeyAlt>KB_NUMPADENTER</HotKeyAlt>
			<bAltDownAlt>0</bAltDownAlt>
			<bShiftDownAlt>0</bShiftDownAlt>
			<bCtrlDownAlt>0</bCtrlDownAlt>
			<iHotKeyPriorityAlt>1</iHotKeyPriorityAlt>
		</ControlInfo>
		<ControlInfo>
			<Type>CONTROL_ENDTURN_ALT</Type>
			<Description>TXT_KEY_ACTION_ENDTURN_ALT</Description>
			<Help>TXT_KEY_ACTION_ENDTURN_ALT_HELP</Help>
			<HotKey>KB_SPACE</HotKey>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<HotKeyAlt/>
			<bAltDownAlt>0</bAltDownAlt>
			<bShiftDownAlt>0</bShiftDownAlt>
			<bCtrlDownAlt>0</bCtrlDownAlt>
			<iHotKeyPriorityAlt>0</iHotKeyPriorityAlt>
		</ControlInfo>
		<ControlInfo>
			<Type>CONTROL_FORCEENDTURN</Type>
			<Description>TXT_KEY_ACTION_FORCE_ENDTURN</Description>
			<Help>TXT_KEY_ACTION_FORCE_ENDTURN_HELP</Help>
			<HotKey>KB_RETURN</HotKey>
			<bAltDown>0</bAltDown>
			<bShiftDown>1</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<HotKeyAlt>KB_NUMPADENTER</HotKeyAlt>
			<bAltDownAlt>0</bAltDownAlt>
			<bShiftDownAlt>1</bShiftDownAlt>
			<bCtrlDownAlt>0</bCtrlDownAlt>
			<iHotKeyPriorityAlt>0</iHotKeyPriorityAlt>
		</ControlInfo>
That defines 3 ways to end a turn which are, as far as I know, the only key presses which will end the turn: the main keyboard enter/return key by itself or with Shift pressed, the number pad enter with or without Shift, and the space bar. In the program itself there must be 3 categories defined which correspond to the 3 Type definitions: CONTROL_ENDTURN, CONTROL_ENDTURN_ALT, and CONTROL_FORCEENDTURN. Each of the 3 sections above defines how those things are activated by a key via the Hot Key tag (along with bAltDown, bShiftDown, and bCtrlDown to indicate if alt, shift, and/or control also need to be in use) and can have an alternate key defined via the HotKeyAlt tag. The priority is involved somehow - possibly to determine what to do if more than one thing specifies the same key.

Anyhow, as far as I know making a mod with changes to the hot key definitions (which are spread across multiple files) is the only way to change the keyboard shortcuts.

It should be possible to list what they all are via Python (they may or may not all actually have descriptive text to explain what they are already in the game), but not change them.

Well, it is probably possible to mod the DLL to create and expose to Python the ability to change hotkeys so you could make a screen to show you the current settings and allow changes. But it might not be - this might be under the control of the .exe in a way that prevents changes like that after the XML is loaded. (I have not checked what is going on in the DLL in this area. I don't know how much, if any, of this stuff is handled by the .exe rather than the DLL.)
 
Top Bottom