1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Hotkeys! 1.3.1

Adds missing hotkeys, along with new functions to help declutter the map

  1. heinous_hat
    So, I've hacked together a small collection of key assignments for UI functions that I find essential for playing Civ6 without going blind, mad or otherwise becoming really irritated :cringe:. Far from LUA competent, I'd like to open the subject for discussion and try to establish some sort of "best practice" approach to further key input modding. These key functions are working for me without issue, but could bear some scrutiny. My main concern is efficiency and not honking up UI performance.

    The first two add a means to toggle normally static UI map elements in order to produce a "clean map" view. Personally, I find this essential when hunting for resource instances or getting a general overview of territory. The others already exist as controls in MinimapPanel, but currently lack a key assignment. Perhaps Firaxis will add these... it seems strange that they're absent.

    • toggle unit icons U
    • toggle city banners X
    • toggle resource icons R
    • toggle yield icons Y

    I think 'heal' and possibly some other unit commands are missing assignments as well. I'll look to those after the map keys.

    All additions are made to DefaultMessageHandler in Ingame.lua. From experience with civ5, placing these here is the only(?) way to have the keys active during the entire turn cycle. Unit icons and city banners work exactly as in civ5... I only switched to uiKey from wParam, following current convention. For resources and yields, I lifted the functions directly from MinimapPanel. Perhaps there's a better way, but I haven't found it. Execution is fast with the exception of the yield display... that noticeably lags, just as it does when performed from the panel. I would expect Firaxis to replace that at some point.

    Here are the changes to DefaultMessageHandler... added key section is marked. Full InGame.lua is attached below...

    DefaultMessageHandler[KeyEvents.KeyUp] =
        function( pInputStruct:table )
            local uiKey = pInputStruct:GetKey();
            if( uiKey == Keys.VK_ESCAPE ) then  
                if( Controls.TopOptionsMenu:IsHidden() ) then
                    return true;
                return false;    -- Already open, let it handle it.
            elseif( uiKey == Keys.B and pInputStruct:IsShiftDown() and pInputStruct:IsAltDown() and (not UI.IsFinalRelease()) ) then
                -- DEBUG: Force unhiding
                local msg:string =  "***PLAYER Force Bulk unhiding SHIFT+ALT+B ***";
                m_bulkHideTracker = 1;
                BulkHide(false, msg);
            elseif( uiKey == Keys.J and pInputStruct:IsShiftDown() and pInputStruct:IsAltDown() and (not UI.IsFinalRelease()) ) then
                if m_bulkHideTracker < 1 then
                    BulkHide(true,  "Forced" );
                    BulkHide(false, "Forced" );
    --  ................ Added Keys ................................ -clp
            elseif ( uiKey == Keys.U ) then
                Controls.UnitFlagManager:SetHide( not Controls.UnitFlagManager:IsHidden() );
                return true;
            elseif ( uiKey == Keys.X ) then
                Controls.CityBannerManager:SetHide( not Controls.CityBannerManager:IsHidden() );
                return true;
            elseif ( uiKey == Keys.R ) then
                UserConfiguration.ShowMapResources( not UserConfiguration.ShowMapResources() );
                return true;
            elseif ( uiKey == Keys.Y ) then
                local showMapYield:boolean = not UserConfiguration.ShowMapYield();
                UserConfiguration.ShowMapYield( showMapYield );
                    if showMapYield then
                return true;
    --.............................................................. end clp
            return false;
    Any feedback would be appreciated. I may release a properly formatted mod (as a forum resource) in the near future, once we see what Firaxis does with updates. I'd also like to reach a consensus on essential hotkeys, as most additions will modify the same file(s).

    Installation: Back up your copy of ..\Sid Meier's Civilization VI\Base\Assets\UI\InGame.lua and replace it with this. If you want to change key assignments, you can easily do so "on the fly" by live editing the document.

    Repackaged as a regular mod. Drop the folder from the archive into the /mod directory and enable from the Additional Content menu.

    Notes: I like to use a 3rd party mouse button manager to bind essential keys. Firaxis' hotkey binder will only work with keys that they've hooked up and doesn't provide certain advanced functionality. I recommend X-Mouse Button Control available here. It's clean (aka free of "offers" and spyware) and has some neat features like button cording. With the cording feature, you can do things like <left button><right button><hold> = rotate camera. This sort of thing really makes my day :).

Recent Updates

  1. Hotkeys!
  2. Hotkeys!
  3. Hotkeys! 1.2
  4. Hotkeys! 1.1

Recent Reviews

  1. babaka001
    Version: 1.2
    Works effectively; no speed degradation; clean, documented code
  2. sp00n
    Version: 1.2
    Does what it says, I use it all the time when looking for resources, artifacts, etc.
  3. camomilk
    Version: 1.2
    Works perfectly and will come in handy for something I'm working on