does any1 know how to get the prog to recognise F1 as an input button to so i can link in a help interface
cheers
Printable View
does any1 know how to get the prog to recognise F1 as an input button to so i can link in a help interface
cheers
Yes, it is very simple:
One downside to this simple approach is that it will repeat the process every few milliseconds you hold the F1 key down. To correct that make a bool variable called F1pressed or something and set it to true at the end of the VK_F1 case statement, then code a WM_KEYUP the same as above just make it so it sets the bool variable to FALSE. Then set up an if statement around your help code to check if the bool variable is TRUE or not. I hope you get this!PHP Code:
//Inside the message switch in the main window loop
case WM_KEYDOWN:
switch(wParam){
case VK_F1:
//Do whatever
break;
}
break;
What library do i need to include for WM_KEYDOWN, wParam and VK_F1?
cheers
That code is for Windows only.
If you wish to do this in DOS, you will need to write and INT 9 handler. Then you only need to check for the correct scan code for the F1 key (find a scan code table for the keyboard).
Thnx mate