>>>Visual FoxPro 7.0 how do I retrieve nKeyCode for function key F2 and F10 in Keypress event.
>>
>>F2 won't work in full VFP environment, because it's reserved for bookmarks. F10 is reserved for activating the menu system. You should use other keys or try manipulating stuff using invisible popups with these as hotkeys (which would be a kludge but might work).
>
>Dragan,
>
>Is this in VFP7 ? or in any ? and if any, what is "full VFP environment" ?
>And do you say that F3...F8 normally work ?
Bookmarks were introduced in 7. I had some code where I tried to use F2 to stuff a predefined string into an editbox, and it wouldn't work - switched to F4 and it worked. It's actually easy to test: in the keypress, just add
case nKeyCode<0
wait "nKeyCode="+tran(nKeyCode) wind nowait
and you'll see which work and which don't.
Full VFP is the GUI, i.e. VFP.exe - to differ from runtime, which shouldn't have the bookmarks and where the F2 may be available. The thing where I used was just a programmer's tool (I was inserting comments in code in the editbox) and I didn't even try to build an .exe out of it, so I can't say if it would see F2 in an exe or not.