Thread: Ascii?

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    9

    Ascii?

    In a calendar program I am supposed to be able to move ahead and move back months by using the right and left arrow keys and exit the program by using ESC (which I know is '27'), what are the arrow keys?

    i've used this code to get some ASCII values but I don't think it gives me the correct ones for the arrows because they are both the same when I do it.
    Code:
    #include <stdio.h>
    #include <conio.h>
    
    #define ESC 27
    
    int main (void)
    {
    	unsigned char ch;
    	printf("press a key to test\n");
    	
    
    	while (ch != ESC)
    	{	
    		ch = getch();	
    		if (ch == 0 || ch == 225)
    		{
    			printf("%d\n", ch);
    			ch = getch();
    		}
    		printf("%c\t%d\t\n", ch, ch);
    	}
    	return 0;
    }
    either telling the codes for the keys or help with the code would be appreciated...

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Does this help?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ASCII character with ASCII value 0 and 32
    By hitesh_best in forum C Programming
    Replies: 4
    Last Post: 07-24-2007, 09:45 AM
  2. Replies: 11
    Last Post: 03-24-2006, 11:26 AM
  3. Office access in C/C++ NOT VC++!! :)
    By skawky in forum C++ Programming
    Replies: 1
    Last Post: 05-26-2005, 01:43 PM
  4. ascii values for keys
    By acid45 in forum C Programming
    Replies: 2
    Last Post: 05-12-2003, 07:13 AM
  5. Checking ascii values of char input
    By yank in forum C Programming
    Replies: 2
    Last Post: 04-29-2003, 07:49 AM