Skip to content

Commit f13aba1

Browse files
review cesarBLG: abstract away call SwitchPanelModule.IsUp into UserInput
1 parent 3e672a8 commit f13aba1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public override void HandleUserInput(ElapsedTime elapsedTime)
321321
train.DbfEvalValueChanged = true;//Debrief eval
322322
}
323323
}
324-
else if (UserInput.IsReleased(command) || SwitchPanelModule.IsUp(command))
324+
else if (UserInput.IsReleased(command))
325325
{
326326
UserInputCommands[command][0]();
327327
//Debrief eval

Source/RunActivity/Viewer3D/UserInput.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ public static bool IsReleased(UserCommand command)
157157
if (RDState != null && RDState.IsReleased(command))
158158
return true;
159159
var setting = InputSettings.Commands[(int)command];
160-
return !setting.IsKeyDown(KeyboardState) && setting.IsKeyDown(LastKeyboardState);
160+
return (!setting.IsKeyDown(KeyboardState) && setting.IsKeyDown(LastKeyboardState)) ||
161+
SwitchPanelModule.IsUp(command);
161162
}
162163

163164
public static bool IsDown(UserCommand command)

0 commit comments

Comments
 (0)