Re: problem with wait_key() and arrows
- Posted by jimcbrown (admin) Sep 18, 2011
- 3109 views
Having part of the i/o system in hll could be a problem:
? get_key() ? gets(0)
If the user keys Esc, "hello" then the hll could buffer a 'h' and the low-level gets return "ello".
Since you've put "ifdef not WINDOWS then" around that code it would mean the behavior differs between platforms.
Regards, Pete
Having ESC sequences processed in Unix-type systems will cause problems regardless of whether this is done in a library or done in the eui executable. In the example you've given, in Unix-type systems we would see ESC-h followed by "ello" and in Windows we would see ESC followed by "hello".
See Wikipedia to get an idea how complex processing escape sequences can get.
All the more reason to get this handled in either the stdlib or in the backend. We shouldn't have to deal with solving this problem every time someone wants to write a console app.