Alt-Enter?

Started by
3 comments, last by ajm113 17 years ago
How do I have it so if the user is pressing Alt - Enter then it triggers the event? I know I need to use these commands put how do I get them to work together so they trigger fulscreen and window mod like Doom3? VK_RETURN = Enter Key VK_MENU = Alt Key. I does not work for some reason....
Check out my open source code projects/libraries! My Homepage You may learn something.
Advertisement
Can you handle the enter key being pressed? If so, think about how you could combine that with GetAsyncKeyState to your advantage. (It tells you if any one of a certain set of system keys is currently pressed or not.)

If, though, you're confused about handling key presses in general, some background information about your application would help in suggesting an answer. Since you're posting in the NeHe forum, though, I'll assume you already have the framework of key handling set up.

Best of luck!
-jouley
Well I am using the first lession on creating the window and I have this code:

if (keys[VK_RETURN]) // Is F8 Being Pressed?
{
keys[VK_RETURN]=FALSE; // If So Make Key FALSE
KillGLWindow(); // Kill Our Current Window
fullscreen=!fullscreen; // Toggle Fullscreen / Windowed Mode
// Recreate Our OpenGL Window
if (!CreateGLWindow("My First Render! - sort of",640,480,16,fullscreen))
{
return 0; // Quit If Window Was Not Created
}

I tried the VK_RETURN | VK_MENU but that does not work. I want it to trigger the fulscreen event on the code. I hope this helps.
Check out my open source code projects/libraries! My Homepage You may learn something.
Have you tried if( keys[VK_RETURN] && keys[VK_ALT] ) or something like that?
Thanks! That worked but I think the VK_ALT is something else... I forgot but I am pretty sure its not VK_MEU aether.
Check out my open source code projects/libraries! My Homepage You may learn something.

This topic is closed to new replies.

Advertisement