473,385 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

'\x1b'

ESC = '\x1b'
BACKSPACE = '\b'

How can I know (maybe a short program) the full list?
I want to make a menu in C, and I want to use the 'left' 'up' 'down', etc...


Apr 24 '06 #1
2 12568
"Olaf \"El Blanco\"" <ve******@yahoo.no> wrote:
ESC = '\x1b'
You do not know this...
BACKSPACE = '\b'
....but you do know this.
How can I know (maybe a short program) the full list?
These are guaranteed by the Standard:

\a is alert (whether this means a bleep, a flash, or something else, is
implementation-dependant).
\b is backspace.
\f is form feed.
\n is new line. It is the character which represents a new line in files
opened in text mode.
\r is carriage return.
\t is a horizontal tab. Size depends on the implementation.
\v is a vertical tab, whatever that is on modern devices.
\' is a literal single quote mark.
\" is a literal double quote mark.
\? is a literal question mark (trigrahps, avoidance, ftpo).
\\ is a literal backslash.

\<octal digits> is the character represented by that octal number, and
\x<hex digits> is the character represented by that hexadecimal number.
The only ones of these of which you reliably know the meaning are
\0, \x0, and equivalent, all of which are character 0, the null
character.

\x1b, as you mention above, is the character with hex value 1b, i.e.
decimal 27. This may or may not represent ESC. It is the character point
for ESC in a very common character set; whether this means that your
implementation also transmits it as an Escape, and whether the OS then
does something sensible with it, is up to them. The Standard neither
does nor reasonably can require it.
I want to make a menu in C, and I want to use the 'left' 'up' 'down', etc...


Can't do that portably. However, if you happen to have a character table
lying around for your OS, and that happens to include cursor key keycode
values, _and_ your implementation gives you these keycodes as input from
the keyboard, you may be able to use these.
Note that any function your implementation may give you to get these
codes without pressing Enter afterwards is non-ISO, unportable, and
therefore off-topic here.

Richard
Apr 24 '06 #2
Olaf "El Blanco" wrote:
ESC = '\x1b'
BACKSPACE = '\b'

How can I know (maybe a short program) the full list?
I want to make a menu in C, and I want to use the 'left' 'up' 'down', etc...


This all greatly depends on what terminal you are
using, and is thus off-topic for this group, as is
mentioned in this groups FAQ.

Also, instead of hard-coding for a specific terminal,
you should probably be using some version of the curses
library (look for 'ncurses' for a popular version).

And, 'curses' is also off-topic for this group.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Apr 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Behrang Dadsetan | last post by:
Hi all, I would like deleting specific characters from a string. As an example, I would like to delete all of the '@' '&' in the string 'You are ben@orange?enter&your&code' so that it becomes...
6
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
10
by: Rocco | last post by:
hi I made the upgrade to python 2.4.3 from 2.4.2. I want to take from google news some atom feeds with a funtion like this import urllib2 def takefeed(url): request=urllib2.Request(url)...
5
by: Anton81 | last post by:
Hi all! I used escape sequences to produce colour output, but a construct like print "%8s" % str_with_escape doesn't do the right thing. I suppose the padding counts the escape characters,...
3
by: zeezlo | last post by:
Hi everyone I would like to get the output of a shell process on Linux (eg, "ls --color=auto") run via os.popen(), filter it and then output parts of it while preserving any original coloring...
10
by: Michael B. Trausch | last post by:
Alright... I am attempting to find a way to parse ANSI text from a telnet application. However, I am experiencing a bit of trouble. What I want to do is have all ANSI sequences _removed_ from...
2
by: tjollans | last post by:
Hi, I am currently trying to port my web software AFoC <http://afoc.k.vu> to Windows and have hit a strange problem: it seams that binary files (PNG images in this case) get distorted by...
8
by: mario | last post by:
I have checks in code, to ensure a decode/encode cycle returns the original string. Given no UnicodeErrors, are there any cases for the following not to be True? unicode(s, enc).encode(enc)...
5
by: crybaby | last post by:
I need to ssh into a remote machine and check if mytest.log file is there. I have setup ssh keys to handle login authentications. How do I determine if mytest.log is there by using Pexpect. What...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.