Skip to content

Commit

Permalink
Better hack for the "Randall Munroe" (shift+enter) bug. Thanks to Cur…
Browse files Browse the repository at this point in the history
…tis Bright.
  • Loading branch information
alexd committed Feb 20, 2011
1 parent ad5e680 commit fe2e3f1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions metapad.c
Expand Up @@ -143,9 +143,9 @@ extern atoi(const char*);
#endif
#else
#ifdef USE_RICH_EDIT
#define STR_ABOUT_NORMAL _T("metapad 3.6 beta 1")
#define STR_ABOUT_NORMAL _T("metapad 3.6 beta 2")
#else
#define STR_ABOUT_NORMAL _T("metapad LE 3.6 beta 1")
#define STR_ABOUT_NORMAL _T("metapad LE 3.6 beta 2")
#endif
#endif

Expand Down Expand Up @@ -7212,8 +7212,15 @@ LONG WINAPI MainWndProc(HWND hwndMain, UINT Msg, WPARAM wParam, LPARAM lParam)
break;
case ID_SHIFT_ENTER:
#ifdef USE_RICH_EDIT
SendMessage(client, WM_KEYDOWN, (WPARAM)VK_RETURN, 0);
SendMessage(client, WM_KEYUP, (WPARAM)VK_RETURN, 0);
{
BYTE keys[256];
GetKeyboardState(keys);
keys[VK_SHIFT] &= 0x7F;
SetKeyboardState(keys);
SendMessage(client, WM_KEYDOWN, (WPARAM)VK_RETURN, 0);
keys[VK_SHIFT] |= 0x80;
SetKeyboardState(keys);
}
#else
SendMessage(client, WM_CHAR, (WPARAM)'\r', 0);
#endif
Expand Down

0 comments on commit fe2e3f1

Please sign in to comment.