Skip to content

Commit 5269e53

Browse files
committed
Mapped special inputs to right control instead of both left and right control
1 parent 5766d53 commit 5269e53

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8181

8282
- The `LimbPath` property `NormalTravelSpeed` has been renamed to just `TravelSpeed`.
8383

84+
- All ctrl+* special inputs functionality (i.e restarting activity, world dumps, showing performance stats) are now mapped to right ctrl, to not interfere with default couching input.
85+
8486
</details>
8587

8688
<details><summary><b>Fixed</b></summary>

Source/Lua/LuaBindingsManagers.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ LuaBindingRegisterFunctionDefinitionForType(ManagerLuaBindings, UInputMan) {
403403

404404
.property("FlagAltState", &UInputMan::FlagAltState)
405405
.property("FlagCtrlState", &UInputMan::FlagCtrlState)
406+
.property("FlagRCtrlState", &UInputMan::FlagRCtrlState)
406407
.property("FlagShiftState", &UInputMan::FlagShiftState)
407408

408409
.def("GetInputDevice", &UInputMan::GetInputDevice)

Source/Managers/FrameMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ void FrameMan::Draw() {
899899
blit(m_NetworkBackBufferFinal8[m_NetworkFrameReady][0].get(), m_BackBuffer8.get(), 0, 0, 0, 0, m_BackBuffer8->w, m_BackBuffer8->h);
900900
masked_blit(m_NetworkBackBufferFinalGUI8[m_NetworkFrameReady][0].get(), m_BackBuffer8.get(), 0, 0, 0, 0, m_BackBuffer8->w, m_BackBuffer8->h);
901901

902-
if (g_UInputMan.FlagAltState() || g_UInputMan.FlagCtrlState() || g_UInputMan.FlagShiftState()) {
902+
if (g_UInputMan.FlagAltState() || g_UInputMan.FlagRCtrlState()) {
903903
g_PerformanceMan.DrawCurrentPing();
904904
}
905905

Source/Managers/UInputMan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ void UInputMan::HandleSpecialInput() {
864864
}
865865
// Ctrl+R or Back button for controllers to reset activity.
866866
if (!g_MetaMan.GameInProgress() && !g_ActivityMan.ActivitySetToRestart()) {
867-
g_ActivityMan.SetRestartActivity((FlagCtrlState() && KeyPressed(SDLK_r)) || AnyBackPress());
867+
g_ActivityMan.SetRestartActivity((FlagRCtrlState() && KeyPressed(SDLK_r)) || AnyBackPress());
868868
}
869869
if (g_ActivityMan.ActivitySetToRestart()) {
870870
return;
@@ -875,7 +875,7 @@ void UInputMan::HandleSpecialInput() {
875875
return;
876876
}
877877

878-
if (FlagCtrlState() && !FlagAltState()) {
878+
if (FlagRCtrlState() && !FlagAltState()) {
879879
// Ctrl+S to save continuous ScreenDumps
880880
if (KeyHeld(SDLK_s)) {
881881
g_FrameMan.SaveScreenToPNG("ScreenDump");
@@ -899,7 +899,7 @@ void UInputMan::HandleSpecialInput() {
899899
g_TimerMan.SetDeltaTimeSecs(c_DefaultDeltaTimeS);
900900
}
901901
}
902-
} else if (!FlagCtrlState() && FlagAltState()) {
902+
} else if (!FlagRCtrlState() && FlagAltState()) {
903903
if (KeyPressed(SDLK_F2)) {
904904
ContentFile::ReloadAllBitmaps();
905905
// Alt+Enter to switch resolution multiplier

Source/Managers/UInputMan.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ namespace RTE {
159159
/// @return Whether any back buttons have been pressed at all since last frame.
160160
bool AnyBackPress();
161161

162+
/// Gets the state of the Right Ctrl key.
163+
/// @return The state of the Right Ctrl key.
164+
bool FlagRCtrlState() const { return ((SDL_GetModState() & KMOD_RCTRL) > 0) ? true : false; }
165+
162166
/// Gets the state of the Ctrl key.
163167
/// @return The state of the Ctrl key.
164168
bool FlagCtrlState() const { return ((SDL_GetModState() & KMOD_CTRL) > 0) ? true : false; }

0 commit comments

Comments
 (0)