Termios and extended ascii codes

Hi,

I have a console using termios and I have noticed that it does not seem to support the extended ascii codes. For example, when I entered ALT+200, instead of reading 200, I read two characters (67 and 8). In my program, I would like to ignore the extended ascii codes (128 and above) but I cannot know if the user entered ALT+200 or really ALT+67 and ALT+8.

Is there a way to configure termios to ignore those characters?

Thank you very much
http://en.wikipedia.org/wiki/Termios.h#Capabilities:_terminfo.2C_termcap.2C_curses.2C_et_al.

There are C++ libraries for databases (the big ones are "terminfo" and "termcap"), but they are not maintained. I have tried what you're doing: intercepting escape sequences, but to no avail. You'll have to use a library that's currently being maintained, or write your program with the intention of only using it with xTerm (xTerm is the X Window manager's terminal, so anyone that runs an X window manager can run your program, which should be everyone). This does require the user to install xTerm if they want to run your program without problems, but it's more portable than, say, writing it only for KDE's Konsole.

As for having the terminal "ignore" them, I don't think it should matter... but I don't klnow what key codes you're talking about, so I can't help you there. If any send a signal, you could try to intercept it (like SIGINT, or, more commonly know as CTRL + C, or ^C) so that the program can continue on.
Topic archived. No new replies allowed.