Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   recognizing function key (http://www.go4expert.com/forums/recognizing-function-key-t12120/)

dssr 15Jul2008 23:18

recognizing function key
 
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??

shabbir 16Jul2008 09:24

Re: recognizing function key
 
Write your WndProc and see if it gets called for the Fn Keypress. If yes check out the code in Msg.

dssr 16Jul2008 14:14

Re: recognizing function key
 
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

xpi0t0s 16Jul2008 14:21

Re: recognizing function key
 
What operating system are you using? It's not the same for all.

dssr 16Jul2008 18:34

Re: recognizing function key
 
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?

xpi0t0s 16Jul2008 23:22

Re: recognizing function key
 
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.


All times are GMT +5.5. The time now is 13:34.