Does anyone know the ascii value for the pause/break key?
Printable View
Does anyone know the ascii value for the pause/break key?
The code for the <Escape> key is 0x1B (no quotes) if that's what you're after...
Hope it helps...Code:
printf("* * * * * MAIN MENU * * * * *\n\n");
printf("PLEASE SELECT:\n\n");
printf("SOMETHING #1 <1>\n");
printf("SOMETHING #2 <2>\n\n");
printf("TO QUIT PROGRAM PRESS <Esc> ");
ch=getch();
switch(ch)
{
case '1' : something_to_do;
break;
case '2' : something_a_bit_different;
break;
case 0x1B: break;
default : printf("* * * <%c> IS NOT A VALID SELECTION * * *\a",ch);
break;
} /* end switch */
if(ch==0x1B) break; /* from a while loop... */
Cheers from MrB ;)
to my knowledge, the pause/break key doesn't have an ascii value. but the virtual-key code is VK_PAUSE.Quote:
Originally posted by SavesTheDay
Does anyone know the ascii value for the pause/break key?
What is The VK_Pause, We're suppose to write a program that exits when someone strikes the Break Key, and we don't know how to accomplish this.
What you are looking for is Crtl-C in Windows. Check to see if the choice == EOF and break if so. That is the Break command in Windows. If you are checking Esc, test (choice == 27). This just will not work on some systems, but that is how you do it.
e.g.
if ((choice == 'q') || (choice == EOF) || ( choice == 27))
{
return 0;
}
good luck on finishing by 8:30.
p.s. you shouldn't have dropped Discrete, lol
dude! hahaha....i can't believe you read that this late....it's 2am and our programming is finally working....you gotta give me your e-mail addy and name so I can write you sometime....how did the Discrete test go for you? i sure enough dropped it like a *****...but enjoy the rest of the semester! my uark addy is ct***[email protected], drop me a line sometime.