From: John Tsiombikas Date: Tue, 8 Mar 2022 01:11:49 +0000 (+0000) Subject: implemented SUPER key/modifier support on windows X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;ds=sidebyside;h=dcea2892e0674b837d45b61d842c017ec115467f;p=freeglut implemented SUPER key/modifier support on windows git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1877 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/mswin/fg_main_mswin.c b/src/mswin/fg_main_mswin.c index 6d286e7..e9d455d 100644 --- a/src/mswin/fg_main_mswin.c +++ b/src/mswin/fg_main_mswin.c @@ -575,7 +575,9 @@ static int fgPlatformGetModifiers (void) ( ( ( GetKeyState( VK_LCONTROL ) < 0 ) || ( GetKeyState( VK_RCONTROL ) < 0 )) ? GLUT_ACTIVE_CTRL : 0 ) | ( ( ( GetKeyState( VK_LMENU ) < 0 ) || - ( GetKeyState( VK_RMENU ) < 0 )) ? GLUT_ACTIVE_ALT : 0 ); + ( GetKeyState( VK_RMENU ) < 0 )) ? GLUT_ACTIVE_ALT : 0 ) | + ( ( ( GetKeyState( VK_LWIN ) < 0 ) || + ( GetKeyState( VK_RWIN ) < 0 )) ? GLUT_ACTIVE_SUPER : 0 ); } /* Check whether a button (VK_*BUTTON) is currently depressed. Returns @@ -631,6 +633,8 @@ static LRESULT fghWindowProcKeyPress(SFG_Window *window, UINT uMsg, GLboolean ke FG_KEY( VK_RIGHT, GLUT_KEY_RIGHT ); FG_KEY( VK_DOWN, GLUT_KEY_DOWN ); FG_KEY( VK_INSERT, GLUT_KEY_INSERT ); + FG_KEY( VK_LWIN, GLUT_KEY_SUPER_L ); + FG_KEY( VK_RWIN, GLUT_KEY_SUPER_R ); /* handle control, alt and shift. For GLUT, we want to distinguish between left and right presses. * The VK_L* & VK_R* left and right Alt, Ctrl and Shift virtual keys are however only used as parameters to GetAsyncKeyState() and GetKeyState()