pchaloux
asked on
Escape Code
If you want to type a backslash you have to do :
printf("\\");
if you want a bell it's \a
a horizontal tab is \t
...
What is the code for ESCAPE.
printf("\\");
if you want a bell it's \a
a horizontal tab is \t
...
What is the code for ESCAPE.
"\033"
the asci value of the escape key is 27 (dec).
I didn't get what actually do you want. If you want to check which key is pressed then you can check it by comparing to 27 (ASCII for Esc). Why else you want a god for Escape?
33 is octal - 3*8 + 3 = 24 + 3 = 27
You cannot type the Escape character - it does not have graphical representation.
ASKER
Ok guys, I got it, but could you please send an ANSWER so I could grade someone.
You only gave me COMMENTs...
You only gave me COMMENTs...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The reason everybody was giving comments was that Ozo answered first in a comment and it usually considered good form to let him get the points because of this.
I suspect the reason he gave a comment rather than an answer was he was expecting you to ask a follow up question.
If you want to give Ozo the pts you can reject Pacman's answer and post a comment asking Ozo to lock the Quesiton
I suspect the reason he gave a comment rather than an answer was he was expecting you to ask a follow up question.
If you want to give Ozo the pts you can reject Pacman's answer and post a comment asking Ozo to lock the Quesiton
Hi
when i tried to print it displays <- (left arrow) sign
printf("%c",27);
when i tried to read it from keyboard i.e,.
ch=getch();
printf("%c",ch);
it displays the same sign
That mean thats the graphical representation of escape key ?
when i tried to print it displays <- (left arrow) sign
printf("%c",27);
when i tried to read it from keyboard i.e,.
ch=getch();
printf("%c",ch);
it displays the same sign
That mean thats the graphical representation of escape key ?
manjucee,
The Escape key is not intended to be shown; if you want to display left arrow, you just look at the ASCII table and pick the arrow from there. It's a coincidence that the image of ASCII code 27 is an arrow. I'm not sure, but I believe that the ASCII table does not defines images for the codes below 32.
The Escape key is a prefix for the "escape sequences" used to control different output devices.
The Escape key is not intended to be shown; if you want to display left arrow, you just look at the ASCII table and pick the arrow from there. It's a coincidence that the image of ASCII code 27 is an arrow. I'm not sure, but I believe that the ASCII table does not defines images for the codes below 32.
The Escape key is a prefix for the "escape sequences" used to control different output devices.