From 18e69b4df131073aa3562ec74372c0e1ead14202 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sat, 22 May 2021 11:31:15 +0200 Subject: [PATCH] Add better support for compose binds in demo menu I assume shift is a common compose bind. So users might have bound shift+scroll or shift+arrowkeys to something else and do not want to change the playback speed while triggering that compose bind. --- src/game/client/components/menus_demo.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 1045fd747..1a7ad38c6 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -169,15 +169,18 @@ void CMenus::RenderDemoPlayer(CUIRect MainView) if(m_pClient->m_pGameConsole->IsClosed() && m_DemoPlayerState == DEMOPLAYER_NONE && g_Config.m_ClDemoKeyboardShortcuts) { // increase/decrease speed - if(Input()->KeyPress(KEY_MOUSE_WHEEL_UP) || Input()->KeyPress(KEY_UP)) + if(!Input()->KeyIsPressed(KEY_LSHIFT) && !Input()->KeyIsPressed(KEY_RSHIFT)) { - DemoPlayer()->SetSpeedIndex(+1); - LastSpeedChange = time_get(); - } - else if(Input()->KeyPress(KEY_MOUSE_WHEEL_DOWN) || Input()->KeyPress(KEY_DOWN)) - { - DemoPlayer()->SetSpeedIndex(-1); - LastSpeedChange = time_get(); + if(Input()->KeyPress(KEY_MOUSE_WHEEL_UP) || Input()->KeyPress(KEY_UP)) + { + DemoPlayer()->SetSpeedIndex(+1); + LastSpeedChange = time_get(); + } + else if(Input()->KeyPress(KEY_MOUSE_WHEEL_DOWN) || Input()->KeyPress(KEY_DOWN)) + { + DemoPlayer()->SetSpeedIndex(-1); + LastSpeedChange = time_get(); + } } // pause/unpause