From 4a0e93fe28dfc63b03b146cf7dbb52e253747883 Mon Sep 17 00:00:00 2001
From: tomcw Debug arguments:
Ctrl+PrintScrn: Alt+Enter:
-dcd
For the SSC's 6551's Status register's DCD bit, use this switch to force AppleWin to use the state of the MS_RLSD_ON bit from GetCommModemStatus().
+ -alt-enter=<toggle-full-screen|open-apple-enter>
+ Define the behavior of Alt+Enter:
+
+
-
Copy the text screen (auto detect 40/80 columns) to the clipboard.
- Toggle between windowed and full screen video modes. (NB. Will conflict with emulation when doing Open Apple + Enter.)
Function Keys F1-F8:
These PC function keys correspond to buttons on the toolbar.
Function Key F2 + Ctrl:
diff --git a/source/Applewin.cpp b/source/Applewin.cpp
index 512cc541..188ab1b7 100644
--- a/source/Applewin.cpp
+++ b/source/Applewin.cpp
@@ -1257,6 +1257,14 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
{
sg_SSC.SupportDCD(true);
}
+ else if (strcmp(lpCmdLine, "-alt-enter=toggle-full-screen") == 0) // GH#556
+ {
+ SetAltEnterToggleFullScreen(true);
+ }
+ else if (strcmp(lpCmdLine, "-alt-enter=open-apple-enter") == 0) // GH#556
+ {
+ SetAltEnterToggleFullScreen(false);
+ }
else // unsupported
{
LogFileOutput("Unsupported arg: %s\n", lpCmdLine);
diff --git a/source/Frame.cpp b/source/Frame.cpp
index 6a6f0c98..ee031b02 100644
--- a/source/Frame.cpp
+++ b/source/Frame.cpp
@@ -175,6 +175,15 @@ void ScreenWindowResize(const bool bCtrlKey);
void FrameResizeWindow(int nNewScale);
+// ==========================================================================
+
+static bool g_bAltEnter_ToggleFullScreen = true; // Default for ALT+ENTER is to toggle between windowed and full-screen modes
+
+void SetAltEnterToggleFullScreen(bool mode)
+{
+ g_bAltEnter_ToggleFullScreen = mode;
+}
+
// ==========================================================================
// Display construction:
@@ -1733,15 +1742,15 @@ LRESULT CALLBACK FrameWndProc (
}
break;
- case WM_SYSKEYDOWN:
+ case WM_SYSKEYDOWN: // ALT + any key; or F10
KeybUpdateCtrlShiftStatus();
// http://msdn.microsoft.com/en-us/library/windows/desktop/gg153546(v=vs.85).aspx
// v1.25.0: Alt-Return Alt-Enter toggle fullscreen
- if (g_bAltKey && (wparam == VK_RETURN)) // NB. VK_RETURN = 0x0D; Normally WM_CHAR will be 0x0A but ALT key triggers as WM_SYSKEYDOWN and VK_MENU
+ if (g_bAltEnter_ToggleFullScreen && g_bAltKey && (wparam == VK_RETURN)) // NB. VK_RETURN = 0x0D; Normally WM_CHAR will be 0x0A but ALT key triggers as WM_SYSKEYDOWN and VK_MENU
return 0; // NOP -- eat key
- else
- PostMessage(window,WM_KEYDOWN,wparam,lparam);
+
+ PostMessage(window,WM_KEYDOWN,wparam,lparam);
if ((wparam == VK_F10) || (wparam == VK_MENU)) // VK_MENU == ALT Key
return 0;
@@ -1752,10 +1761,11 @@ LRESULT CALLBACK FrameWndProc (
KeybUpdateCtrlShiftStatus();
// v1.25.0: Alt-Return Alt-Enter toggle fullscreen
- if (g_bAltKey && (wparam == VK_RETURN)) // NB. VK_RETURN = 0x0D; Normally WM_CHAR will be 0x0A but ALT key triggers as WM_SYSKEYDOWN and VK_MENU
+ if (g_bAltEnter_ToggleFullScreen && g_bAltKey && (wparam == VK_RETURN)) // NB. VK_RETURN = 0x0D; Normally WM_CHAR will be 0x0A but ALT key triggers as WM_SYSKEYDOWN and VK_MENU
ScreenWindowResize(false);
else
PostMessage(window,WM_KEYUP,wparam,lparam);
+
break;
case WM_MENUCHAR: // GH#556 - Suppress the Windows Default Beep (ie. Ding) whenever ALT+