-
disabling the ALT-key
I'm creating a fullscreen openGL program, and I've ran into a problem.
When I press ALT-SHIFT, my screen turns black. Does anyone know how to disable the alt key ?
Ive tried these , but they don't work.
Code:
case WM_SYSKEYDOWN:
switch (wParam)
{
case VK_MENU:
return 0;
}
case WM_SYSKEYUP:
switch (wParam)
{
case VK_MENU:
return 0;
}
Code:
case WM_KEYDOWN:
switch (wParam)
{
case VK_MENU:
return 0;
}
case WM_KEYUP:
switch (wParam)
{
case VK_MENU:
return 0;
}
-
Well if your only concerned with ALT-SHIFT combo the problem is that your logic is a little skewed in the wrong direction. The thing is once you press another key with the ALT key pressed the other keycode is contained in wParam and the status of the ALT key is contained in WPARAM. So to disable the ALT_SHIFT combo and everything besides ALT_TAB one would need to set up the message loop like:
Code:
case WM_SYSKEYDOWN:
if(lParam & 0x20000000) //Check for ALT key
return 0;
break;
To disable ALT_Tab requires extra steps as in Windows retains another message queue for such operations.
-
Inserting that in the code doesn't help. Perhaps it would be better to understand your code :) msdn didn't help though.
What exactly does the lParam value store ?
An what doet the 0x20000000 mean in this context ?