Input: Prevent alt key from activating menu when using keyboard mode

This commit is contained in:
Sour 2019-11-03 12:02:53 -05:00
parent 08edcdd1e0
commit a75294320b
3 changed files with 6 additions and 0 deletions

View file

@ -35,6 +35,9 @@ namespace Mesen.GUI.Forms
//Prevent default Windows behavior on F10 / Shift+F10 presses, which causes issues
//such as the Shift key not being processed as being released, etc.
return true;
} else if(keyData.HasFlag(Keys.Alt) && InteropEmu.IsKeyboardMode()) {
//Prevent Alt key from activating menu when in keyboard mode
return true;
}
return result;

View file

@ -75,6 +75,7 @@ namespace Mesen.GUI
[DllImport(DLLPath)] public static extern void UpdateInputDevices();
[DllImport(DLLPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool IsKeyboardMode();
[DllImport(DLLPath)] public static extern ConsoleFeatures GetAvailableFeatures();
[DllImport(DLLPath, EntryPoint = "GetPressedKeys")] private static extern void GetPressedKeysWrapper(IntPtr keyBuffer);

View file

@ -674,6 +674,8 @@ namespace InteropEmu {
DllExport void __stdcall StopRecordingTapeFile() { _console->StopRecordingTapeFile(); }
DllExport bool __stdcall IsRecordingTapeFile() { return _console->IsRecordingTapeFile(); }
DllExport bool __stdcall IsKeyboardMode() { return _settings->IsKeyboardMode(); }
DllExport ConsoleFeatures __stdcall GetAvailableFeatures() { return _console->GetAvailableFeatures(); }
//NSF functions