No F10

Started by
5 comments, last by xiros 20 years, 11 months ago
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?
Advertisement
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.
I tried release and it had the same problem.
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)
F12 works fine, but not F10. Is there a way to get F10 with the windows messaging loop? Even outside VC++ in release mode F10 doesn''t work.
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.

  //Global varbool tester = true;//Test for f10if (tester)  F10Down = (GetAsyncKeyState(VK_F10) & 1);else  F10Down = (GetAsyncKeyState(VK_F10) & 0x8000);//On WM_ACTIVATEAPPif (Deactivate)  tester=false;  

This topic is closed to new replies.

Advertisement