1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 13:50:36 +00:00

Change freeglut to only look for ctrl/alt/shift down events when window

has focus.

Previously this functionality was in libqb.
This commit is contained in:
Luke Ceddia 2017-10-10 13:47:10 +11:00
parent 6e0fd03256
commit 86a6646bdb
2 changed files with 50 additions and 59 deletions

View file

@ -29745,23 +29745,12 @@ void sub__maptriangle(int32 cull_options,float sx1,float sy1,float sx2,float sy2
if (key==GLUT_KEY_INSERT){vk=0x5200;}
#ifdef CORE_FREEGLUT
#ifdef QB64_WINDOWS
if (window_handle==GetForegroundWindow()) {
if (key==112){vk=VK+QBVK_LSHIFT;}
if (key==113){vk=VK+QBVK_RSHIFT;}
if (key==114){vk=VK+QBVK_LCTRL;}
if (key==115){vk=VK+QBVK_RCTRL;}
if (key==116){vk=VK+QBVK_LALT;}
if (key==117){vk=VK+QBVK_RALT;}
}
#else
if (key==112){vk=VK+QBVK_LSHIFT;}
if (key==113){vk=VK+QBVK_RSHIFT;}
if (key==114){vk=VK+QBVK_LCTRL;}
if (key==115){vk=VK+QBVK_RCTRL;}
if (key==116){vk=VK+QBVK_LALT;}
if (key==117){vk=VK+QBVK_RALT;}
#endif
#endif
if (vk!=-1){

View file

@ -1948,6 +1948,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
if ( window )
{
/* Checking for CTRL, ALT, and SHIFT key positions: Key Down! */
if (hWnd == GetForegroundWindow()) {
if ( !lControl && GetAsyncKeyState ( VK_LCONTROL ) )
{
INVOKE_WCB ( *window, Special,
@ -2001,6 +2002,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
rAlt = 1;
}
}
/* Checking for CTRL, ALT, and SHIFT key positions: Key Up! */
if ( lControl && !GetAsyncKeyState ( VK_LCONTROL ) )