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
This commit is contained in:
fayjf 2012-06-10 19:35:13 +00:00
parent 6a9df93b5f
commit 9165411c7a

View File

@ -794,6 +794,12 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
KEY( VK_DOWN, GLUT_KEY_DOWN ); KEY( VK_DOWN, GLUT_KEY_DOWN );
KEY( VK_INSERT, GLUT_KEY_INSERT ); 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: case VK_DELETE:
/* The delete key should be treated as an ASCII keypress: */ /* The delete key should be treated as an ASCII keypress: */
INVOKE_WCB( *window, Keyboard, 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_DOWN, GLUT_KEY_DOWN );
KEY( VK_INSERT, GLUT_KEY_INSERT ); 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: case VK_DELETE:
/* The delete key should be treated as an ASCII keypress: */ /* The delete key should be treated as an ASCII keypress: */
INVOKE_WCB( *window, KeyboardUp, INVOKE_WCB( *window, KeyboardUp,