Skip to content

Commit ecaa6d7

Browse files
committed
Automatic merge of T1.5.1-1004-g6fd841761e and 23 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #885 at 2728d6d: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 3e390b8: Downloading route content (Github, zip) - Pull request #912 at 359cfee: New Triple Valve Features Vol. 2 - Pull request #922 at a3bc9e7: Autopilot for timetable mode - Pull request #946 at 91a03af: Advanced track sounds - Pull request #949 at da7663b: Oil Burning Locomotive - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 84c2f4b: Add Support for Multiple Track Profiles - Pull request #956 at 406cba6: Map settings saved - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #960 at c8e2a28: Fix draw state name in scripts - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #963 at 2d5a67d: Fix dynamic brake force indicator - Pull request #964 at b11c894: fix: Warning CA1417: Do not use the 'OutAttribute' for string parameter
25 parents 6ac9bd8 + 6fd8417 + dfc715e + d00beb9 + f92de76 + 8f695a4 + 2728d6d + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 3e390b8 + 359cfee + a3bc9e7 + 91a03af + da7663b + 8347095 + a519452 + 84c2f4b + 406cba6 + 2452cb0 + c8e2a28 + 46d0472 + 2d5a67d + b11c894 commit ecaa6d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/ORTS.Settings/InputSettings.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ enum MapVirtualKeyType
147147
static extern int MapVirtualKey(int code, MapVirtualKeyType type);
148148

149149
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
150-
static extern int GetKeyNameText(int scanCode, [Out] string name, int nameLength);
150+
static extern int GetKeyNameText(int scanCode, [Out] char[] name, int nameLength);
151151
#endregion
152152

153153
// Keyboard scancodes are basically constant; some keyboards have extra buttons (e.g. UK ones tend to have an
@@ -654,9 +654,9 @@ public static Keys GetScanCodeKeys(int scanCode)
654654
public static string GetScanCodeKeyName(int scanCode)
655655
{
656656
var xnaName = Enum.GetName(typeof(Keys), GetScanCodeKeys(scanCode));
657-
var keyName = new String('\0', 32);
658-
var keyNameLength = GetKeyNameText(scanCode << 16, keyName, keyName.Length);
659-
keyName = keyName.Substring(0, keyNameLength);
657+
var keyNameBuffer = new char[32];
658+
var keyNameLength = GetKeyNameText(scanCode << 16, keyNameBuffer, keyNameBuffer.Length);
659+
var keyName = new string(keyNameBuffer, 0, keyNameLength);
660660

661661
if (keyName.Length > 0)
662662
{

0 commit comments

Comments
 (0)