From 9165411c7a11fe8239c6296bfd379314ddc29711 Mon Sep 17 00:00:00 2001 From: fayjf Date: Sun, 10 Jun 2012 19:35:13 +0000 Subject: [PATCH] Fixing the situation in which the special-key-up callback is called twice when Ctrl, Alt, or Shift is released. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1340 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/mswin/fg_main_mswin.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/freeglut/freeglut/src/mswin/fg_main_mswin.c b/freeglut/freeglut/src/mswin/fg_main_mswin.c index 0f7f4ae..b766dd2 100644 --- a/freeglut/freeglut/src/mswin/fg_main_mswin.c +++ b/freeglut/freeglut/src/mswin/fg_main_mswin.c @@ -794,6 +794,12 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, KEY( VK_DOWN, GLUT_KEY_DOWN ); KEY( VK_INSERT, GLUT_KEY_INSERT ); + case VK_LCONTROL: case VK_RCONTROL: case VK_CONTROL: + case VK_LSHIFT: case VK_RSHIFT: case VK_SHIFT: + case VK_LMENU: case VK_RMENU: case VK_MENU: + /* These keypresses and releases are handled earlier in the function */ + break; + case VK_DELETE: /* The delete key should be treated as an ASCII keypress: */ INVOKE_WCB( *window, Keyboard, @@ -880,6 +886,12 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, KEY( VK_DOWN, GLUT_KEY_DOWN ); KEY( VK_INSERT, GLUT_KEY_INSERT ); + case VK_LCONTROL: case VK_RCONTROL: case VK_CONTROL: + case VK_LSHIFT: case VK_RSHIFT: case VK_SHIFT: + case VK_LMENU: case VK_RMENU: case VK_MENU: + /* These keypresses and releases are handled earlier in the function */ + break; + case VK_DELETE: /* The delete key should be treated as an ASCII keypress: */ INVOKE_WCB( *window, KeyboardUp,