recognizing function key

dssr's Avatar, Join Date: Feb 2008
Go4Expert Member
can any one tell me how to recognize a function key in C, i mean function key does not have any ASCII value, so if i want to execute a command after pressing a function key then how can i do that??
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Write your WndProc and see if it gets called for the Fn Keypress. If yes check out the code in Msg.
0
dssr's Avatar, Join Date: Feb 2008
Go4Expert Member
can you be more specific??
I have searched everywhere for function key equivalent
Even I have typed a program for finding the ASCII you press a key and corresponding ASCII value will be shown on the screen
In that program too the ASCII code is not showing

So is there any other method with which i can recognize ascii code
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
What operating system are you using? It's not the same for all.
0
dssr's Avatar, Join Date: Feb 2008
Go4Expert Member
Quote:
Originally Posted by xpi0t0s
What operating system are you using? It's not the same for all.
simple windows xp, i know it's different for Mac and other, but i dont think function key has any ascii code for any of them donno about UNICODE, have not searched

but as i want to implement using C then i have to do it in ascii code, aint it?
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
No. ASCII is a characterset and has nothing to do with reading the keyboard. Some of the values correspond but that's about it.
Have a look at Get KeyState and GetAsyncKeyState in the Windows API reference. The key name constants begin with VK_, so the keycode for F1 is VK_F1. Innit.