By default, camera in Civilization 6 is controlled by either pointing the mouse to the screen's borders or by the arrow keys. This is not entirely convenient and unusual for some users. The problem is that you cannot reassign these buttons in the game settings. So, how can you assign more suitable keys for scrolling the camera (for example familiar to everyone WASD)?
In addition to the standard game settings, Sid Meier's Civilization VI has a fairly flexible system for changing its behavior using different parameters that can be found in various *.xml files, as well as functions in *.lua files. All these features are actively used in the creation of mods, but now it's not about them, but only a slight change in the camera's management.
So, in order to change the camera's control keys, you need to edit the WorldInput.lua file. By default it can be found by C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\UI\ path.
After you found the file do not forget to backup it before editing. Next, open it in your favorite text editor and look for the function DefaultKeyDownHandler (look for the string "function DefaultKeyDownHandler"). In this function you find lines similar to these:
if( uiKey == Keys.VK_UP) then
if( uiKey == Keys.VK_DOWN) then
and so on for all 4 arrow keys.
You just need to add the keystrokes codes you need to these conditions. In order to control the camera with WASD keys these conditions must look like:
if( uiKey == Keys.VK_UP or uiKey == Keys.W) then
if( uiKey == Keys.VK_RIGHT or uiKey == Keys.D) then
if( uiKey == Keys.VK_DOWN or uiKey == Keys.S) then
if( uiKey == Keys.VK_LEFT or uiKey == Keys.A) then
So you have overrrided the game's behavior for KeyDown event. But you also need to redefine the KeyUp event behavior. Therefore, you also need to edit the DefaultKeyUpHandler function. Find "function DefaultKeyUpHandler" line and add necessary keystrokes codes, in analogy with the DefaultKeyDownHandler function, so that they look like this:
if( uiKey == Keys.VK_UP or uiKey == Keys.W) then
if( uiKey == Keys.VK_RIGHT or uiKey == Keys.D) then
if( uiKey == Keys.VK_DOWN or uiKey == Keys.S) then
if( uiKey == Keys.VK_LEFT or uiKey == Keys.A) then
That's all. Do not forget to save the changes and restart the game.
Enjoy!