Archived

This topic is now archived and is closed to further replies.

No F10

This topic is 5331 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

In NeHe''s basecode, it doesn''t catch the key F10. It also doesn''t even send a WM_KEYDOWN message for F10. Is this just on my computer or does everyone have this problem? The F10 key works fine outside the program. How do I fix this?

Share this post


Link to post
Share on other sites
If I remember correctly, F10 toggles some kind of state flag for VC++ when you compile using the debug libraries. Someone correct me if I am wrong but I remember reading something like this.

The quick fix is try compiling in release mode, and see if that fixes it.

Share this post


Link to post
Share on other sites
F10 and F12 are used by VC++. The problem only happens when you use the windows messaging loops are used to capture the key presses (if you use direct input when it dosn''t happen)

you can always put a breakpoint in the WM_KEYDOWN handling code to see if its being processed (VK_F10)

Share this post


Link to post
Share on other sites
Windows uses F10 to focus on your menu bar - so it is not getting to your key-press loop. You may need to use something like SetWindowsHookEx to get at the keys before the OS does its bit. Also, there may also be some window-creation flag to stop these getting swiped by windows (you chould check microsoft.com) Usually, it is better (heathier to your mental state) to not fight the windows OS on issues like this.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

  
//Global var

bool tester = true;

//Test for f10

if (tester)
F10Down = (GetAsyncKeyState(VK_F10) & 1);
else
F10Down = (GetAsyncKeyState(VK_F10) & 0x8000);

//On WM_ACTIVATEAPP

if (Deactivate)
tester=false;

Share this post


Link to post
Share on other sites