F11 And F12

This is a discussion on F11 And F12 within the C++ Programming forums, part of the General Programming Boards category; Ok so i know how to use the F1-F10 keys but am strugling on F11 And F12, and im really ...

  1. #1
    Fallen AndyBomstad's Avatar
    Join Date
    Jan 2005
    Posts
    52

    F11 And F12

    Ok so i know how to use the F1-F10 keys but am strugling on F11 And F12, and im really not sure how to go about fixing it..

    so if anyone knows how to Access the F11- F12 Keys please let me know thanks
    Last edited by AndyBomstad; 05-10-2005 at 02:43 PM.

  2. #2
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Try 0x87 for F11 and 0x88 for F12.

    Or maybe 0x7A and 0x7B: http://delphi.about.com/od/objectpascalide/l/blvkc.htm
    Last edited by joshdick; 05-10-2005 at 02:13 PM.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  3. #3
    Fallen AndyBomstad's Avatar
    Join Date
    Jan 2005
    Posts
    52
    didnt work..i might be trying it wrong heres the code im working on if ya wanna mess with it

    Code:
    //Menu
    #include <iostream>
    #include <conio.h>
    
    using namespace std;
    
    int main(void)
    {
    	while(true)
    	{
    		system("cls");
            cout<<"####  Main Menu  ####"<<endl;
    		cout<<"F1: Get input:       "<<endl;
    		cout<<"F11: Message:        "<<endl;
    		cout<<"F12: Another Message:"<<endl;
    		cout<<"_____________________"<<endl;
    
    		char choice;
    		choice = getch();
    		if(choice == 0)
    		{
    			choice = getch();
    			if(choice == 0x87) // F11 Key
    			{
    				system("cls");
                    cout<<"You Have Hit F11!"<<endl;
                    system("pause");
    			}
            }
       }
    }
    heres some msnd table...dont know what its saying really either...lol
    http://msdn.microsoft.com/library/de...es_chart_2.asp
    Last edited by AndyBomstad; 05-10-2005 at 02:19 PM.

  4. #4
    Fallen AndyBomstad's Avatar
    Join Date
    Jan 2005
    Posts
    52
    ok now im trying somthing like this its not working either

    Code:
    //Menu
    #include <iostream>
    #include <conio.h>
    
    using namespace std;
    
    int main(void)
    {
    	while(true)
    	{
    		system("cls");
            cout<<"####  Main Menu  ####"<<endl;
    		cout<<"F1: Get input:       "<<endl;
    		cout<<"F11: Message:        "<<endl;
    		cout<<"F12: Another Message:"<<endl;
    		cout<<"_____________________"<<endl;
    
    		char choice;
    		choice = getch();
    		if(choice == 0 ||choice == 224)
    		{
    			choice = getch();
    			if(choice == 87)
    			{
    				system("cls");
                    cout<<"You Have Hit F11!"<<endl;
                    system("pause");
    			}
            }
       }
    }

  5. #5
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,701
    >> this its not working either
    You need to learn how to use a debugger....

    > int choice;
    and
    > if (choice == 133)

    gg

  6. #6
    Fallen AndyBomstad's Avatar
    Join Date
    Jan 2005
    Posts
    52
    Ah geez....lol sorry i slopped that code with the whole "Char choice"....lol alright here it is lol Thanks
    Code:
    //Menu
    #include <iostream>
    #include <conio.h>
    
    using namespace std;
    
    int main(void)
    {
    	while(true)
    	{
    		system("cls");
            cout<<"####  Main Menu  ####"<<endl;
    		cout<<"F1: Get input:       "<<endl;
    		cout<<"F11: Message:        "<<endl;
    		cout<<"F12: Another Message:"<<endl;
    		cout<<"_____________________"<<endl;
    
    		int choice;
    		choice = getch();
    		if(choice == 0 ||choice == 224)
    		{
    			choice = getch();
    			if(choice == 133)
    			{
    				system("cls");
                    cout<<"You Have Hit F11!"<<endl;
                    system("pause");
    			}
            }
       }
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Accepting function key 'F12'
    By Fire Flash in forum C Programming
    Replies: 1
    Last Post: 03-18-2002, 04:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21