• Advertisement
Sign in to follow this  

Alt-Enter?

This topic is 3969 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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....

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Have you tried if( keys[VK_RETURN] && keys[VK_ALT] ) or something like that?

Share this post


Link to post
Share on other sites
Thanks! That worked but I think the VK_ALT is something else... I forgot but I am pretty sure its not VK_MEU aether.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement