Center to Capital and cycle through cities keybindings

Center to Capital and cycle through cities keybindings 0.0.4

Burntz

Chieftain
Joined
Feb 15, 2025
Messages
15
This mod adds custom hotkeys to make city management easier in Civilization VII:

1. Center Camera on Capital (default key: Home)
2. Cycle Through Cities (default keys: PageUp, PageDown)

Pressing the "Center To Capital" hotkey focuses the camera on your capital city. Pressing the "Cycle Cities" hotkeys shifts the camera from one city to another, allowing you to quickly review them all in sequence.

Download here:
 
Last edited:
First it didn´t showed up in the menu and it didnt worked for me as well...but now its working, my fix was: deactivate the mod, restore default settings and activate the mod again. Voilá! Thx for the Mod, I love it!
 
Last edited:
First it didn´t showed up in the menu and it worked for me as well...but now its working, my fix was: deactivate the mod, restore default settings and activate the mod again. Voilá! Thx for the Mod, I love it!
Thanks for the info! I will update the readme 👍
 
Suggestion: Can you Update the Mod and include "Cycle only through Cities (without towns)" and "Cycle only through Towns (without Cities)"? And is there a possibitily to open the City/Town Details with a HotKey as well?
 
I can't get it to work reliably. First I tried it without the optional keybinding library. It worked fine for new games, but once I saved and later loaded that save, none of my mods would load (also see this post). Maybe because of the strict dependency of the library in the modinfo file? When I added the keybinding library it worked for one session. I also saw the keybinds in the game options. I added the Home key as second key through the game options, and every since then the mod just won't work. The keys don't work, on loaded or new games. The keybinds are gone from the game options as well. Whatever I do (deactivate, restore keybind options, reactivate, restart game, etc.), I can't get it to work again. Even when removing all my other mods, it still won't work. The mods are both listed fine in game and both enabled.
 
Last edited:
I can't get it to work reliably. First I tried it without the optional keybinding library. It worked fine for new games, but once I saved and later loaded that save, none of my mods would load (also see this post). Maybe because of the strict dependency of the library in the modinfo file? When I added the keybinding library it worked for one session. I also saw the keybinds in the game options. I added the Home key as second key through the game options, and every since then the mod just won't work. The keys don't work, on loaded or new games. The keybinds are gone from the game options as well. Whatever I do (deactivate, restore keybind options, reactivate, restart game, etc.), I can't get it to work again. Even when removing all my other mods, it still won't work. The mods are both listed fine in game and both enabled.
Hi, thanks for the info. Could you give me a list of other mods you are using so I could try to replicate the issue.
 
Hi, thanks for the info. Could you give me a list of other mods you are using so I could try to replicate the issue.
Even with just the two mods (yours and the library) it doesn't work for me. I just tried it again now: removed all my mods and put yours and the library in, and started a new game. The key won't work and the extra keybinding doesn't show in the keybinding options. I then removed the library mod so I only have your mod installed, but it still won't work somehow.

I can see the mod in the mod list and it is enabled. I can also see it loading in the ui.log and modding.log. I have the Founders edition, so the extra content from that is active. But that shouldn't really be an issue. I normally run with 28 mods and they all work. No idea why your mod won't. Especially since it once did work for a short time. It started malfunctioning when I assigned an extra key to it in the game options last weekend, and I can't get it working ever since.
 

Attachments

Even with just the two mods (yours and the library) it doesn't work for me. I just tried it again now: removed all my mods and put yours and the library in, and started a new game. The key won't work and the extra keybinding doesn't show in the keybinding options. I then removed the library mod so I only have your mod installed, but it still won't work somehow.

I can see the mod in the mod list and it is enabled. I can also see it loading in the ui.log and modding.log. I have the Founders edition, so the extra content from that is active. But that shouldn't really be an issue. I normally run with 28 mods and they all work. No idea why your mod won't. Especially since it once did work for a short time. It started malfunctioning when I assigned an extra key to it in the game options last weekend, and I can't get it working ever since.
Thank you for the logs. I would appreciate if you could test this new version before I release it. It removes the usage of the external library *lib-register-keybinding* that might have been the issue. It also adds possibility for faster city cycling.
https://d3mo.fi/storage/center-to-capital-testing/
 
Thank you for the logs. I would appreciate if you could test this new version before I release it. It removes the usage of the external library *lib-register-keybinding* that might have been the issue. It also adds possibility for faster city cycling.
Yes, this works. I almost thought it didn't, but then saw you changed the default key to Home (much better in my opinion).

It also works with my other 28 mods now. Thanks!
 
Now that I can put this mod back in (thanks again!), I have a suggestion: It would be nice if pressing the Home key for capital would reset the settlement-cycle-list (you cityIndex var), so pressing End hereafter will take you to the second settlement in the list instead of to the next one on the list before you went back to the Capital with Home.

Edit: Also, I'd love to get a key to go to previous settlement as well. Maybe PageUp and PageDown as default keys?
 
Last edited:
Now that I can put this mod back in (thanks again!), I have a suggestion: It would be nice if pressing the Home key for capital would reset the settlement-cycle-list (you cityIndex var), so pressing End hereafter will take you to the second settlement in the list instead of to the next one on the list before you went back to the Capital with Home.

Edit: Also, I'd love to get a key to go to previous settlement as well. Maybe PageUp and PageDown as default keys?
Good to hear that it works now. Also good suggestions. Resetting the index when centering to capital should be easy to add. Also using PgUp and down for cycling is good idea for the next release.:thumbsup:
 
Burntz updated Center to Capital and cycle through cities keybindings with a new update entry:

Compability fix + new features

  • Removed dependency on lib-register-keybinding. input-action-default-gestures.xml now holds the keybindings so they are no longer changeable from the game settings menu.
  • Added user-configurable camera movement (zoom vs. instant).
  • Ensured mod loads last to prevent conflicts.
  • The default keys for Center to Capital is Home and city cycling PageUp=Next city, PageDown=Previous city.
  • If capital is centered and the center-to-capital key is pressed again it opens the Capital...

Read the rest of this update entry...
 
I've briefly tested the new update and that works great. One very minor suggestion (sorry if I'm too detail-oriented): when resetting the cycle you set the index to 1, but that means it skips the second city and goes to the third instead when cycling again. Setting it to 0 solves this (line 59 of focus-capital.js).

Anyway, I love this mod and will be using this a lot. The Home key to center should have been in the game to start with, and you've fixed that with this mod.
 
I've briefly tested the new update and that works great. One very minor suggestion (sorry if I'm too detail-oriented): when resetting the cycle you set the index to 1, but that means it skips the second city and goes to the third instead when cycling again. Setting it to 0 solves this (line 59 of focus-capital.js).

Anyway, I love this mod and will be using this a lot. The Home key to center should have been in the game to start with, and you've fixed that with this mod.
I had issue with resetting the index to 0 that after focusing to Capital and then cycling to next city, it required two presses of the PageUp key. And that was resolved by resetting the index to 1. That made me think that maby the game sets the capitals city index to 1. Im not sure about this, I need to test that little more because I missed the fact that it could skip a city if the Capital is indeed index 0.
 
I had issue with resetting the index to 0 that after focusing to Capital and then cycling to next city, it required two presses of the PageUp key. And that was resolved by resetting the index to 1. That made me think that maby the game sets the capitals city index to 1. Im not sure about this, I need to test that little more because I missed the fact that it could skip a city if the Capital is indeed index 0.
I think the need for two key presses is caused by the extra check you do for whether you opened the capital window. When opening the capital window with Home (while the capital is already focused), you set a Boolean to skip the next settlement cycle action on keypress. That is why the keypress is ignored, I think. I’ve disabled that check and it works fine for me now.

It looks like the capital is index 0 in Antiquity, but settlement order gets completely shuffled in next ages. In my Exploration save, the capital is the fifth settlement in the order, clearly visible in the Global Yields Breakdown window as well. The first settlement (index 0) in that save is a small town that I created as 4th town in Antiquity. So outside of Antiquity you can’t assume that index 0 is the capital. But setting it to index 0 sets it to the city that is top of the list in Global Yields window and in Resource Allocation window (if you don’t have a mod that sorts that list).
 
Playing on MAcBook Pro: Where can I find the "HOME" Key here? :-) Sorry, I am new in the Apple World....
 
Playing on MAcBook Pro: Where can I find the "HOME" Key here? :-) Sorry, I am new in the Apple World....
Hi, check the readme.txt inside the mods folder. There is guide how to change the quick keys. Basically you just change the bindings at the "input-action-default-gestures.xml" file. :)
 
Back
Top Bottom