diff --git a/data/_ui/tooltips.txt b/data/_ui/tooltips.txt index 4d019f2512ce..4cf368801e2d 100644 --- a/data/_ui/tooltips.txt +++ b/data/_ui/tooltips.txt @@ -1183,7 +1183,7 @@ tip "Toggle fullscreen" `Toggle whether the game is in fullscreen mode.` tip "Toggle fast-forward" - `Toggle a 3x speed fast-forward. Fast-forward may be automatically deactivated by the "Interrupt fast-forward" setting.` + `Toggle a 3x speed fast-forward. Fast-forward may be automatically deactivated by the "Interrupt fast-forward" setting. If the key is set to caps-lock then the caps-lock state will be used to determine the fast-forward state.` tip "Show help" `Display the help dialogs that are relevant to your current UI panel and situation. Uses the same help dialogs from the "Reactivate first-time help" setting, forcing them to appear even if they have already appeared before.` diff --git a/source/main.cpp b/source/main.cpp index 3c9787d89112..8a3cde0f700c 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -315,11 +315,17 @@ void GameLoop(PlayerInfo &player, const Conversation &conversation, const string // The UI handled the event. } else if(event.type == SDL_KEYDOWN && !event.key.repeat - && (Command(event.key.keysym.sym).Has(Command::FASTFORWARD))) + && (Command(event.key.keysym.sym).Has(Command::FASTFORWARD)) + && !Command(SDLK_CAPSLOCK).Has(Command::FASTFORWARD)) { isFastForward = !isFastForward; } } + + // Special case: If fastforward is on capslock, update on mod state and not + // on keypress. + if(Command(SDLK_CAPSLOCK).Has(Command::FASTFORWARD)) + isFastForward = SDL_GetModState() & KMOD_CAPS; }; // Game loop when running the game normally.