Khimenko Victor wrote:
The gpc works now on my Linux Mandrake, it is GREAT, it has many more functionality than Borland Pascal 7
In the crtdemo the ESC key doesn't work to quit, is it a problem of my config ?
More like problem with *nix design (not even *nix exacly bu more like old unix terminals design - it's stupid, ugly and unneeded but it's used by SUCH big number of systems all around the world now that it's really not worth trying to fix).
One could probably fix it (under Linux at least) by changing the keymap (or the kernel) and the termcap and terminfo entries. However, this would break:
- programs run remotely unless you install the new termcap/terminfo on the host as well,
- programs that hard-code escapes sequences (but such programs are broken by design, anyway).
ESC key is used as prefix for other keys (like arrows and functional keys - it was even used this way in Turbo Pascal 2.x and 3.x if you recall). And there are NO reliable way to distinguish sequence of keys ESC,[,U from Left arrow, for example (I'm not remember well what exactly sequence is for left arrow but it's not relevant). Plus not all keyboards on teminals have F1-F10 keys, for example and then sequences ESC,1 ... ESC,9 ESC,0 are used instead. Thus for ESC to work you must be patient: just wait few seconds and it'll close program.
Perhaps we should go MC way and use double-ESC as "true" ESC so you can use ESC,ESC when needed and still can use ESC,1 ESC,A and so on without worry ?
Unfortunately (but consequently) double-ESC is the sequence for Alt- (or Meta-)ESC. So, a program could recognize Alt-ESC (kbAltEsc in the CRT unit) as equivalent to ESC. I'm doing it in CRTDemo now, but each program has to do it for itself -- and this could be many places. Alternatively, I could add a flag to CRT which, if set, will cause CRT to transparently translate Alt-ESC to ESC (if the flag is not set, Alt-ESC can be distinguished from ESC for programs that want this). Should I do so?
But even worse, there are sequences that start with double-ESC, e.g. Alt-function key, so the code has to wait further after reading double-ESC. So, if you press ESC three times, you get an Alt-ESC and (after some delay) a plain ESC. So, if Alt-ESC terminates the program (like CRTDemo with my next changes), that works, since Alt-ESC terminates the program and it won't get to the delay...
But generally, on a local console, I have no problems with a small ESCDELAY -- if you set it larger than ~30, repeated ESC keys (i.e. holding down the key) will get converted to Alt-ESC, but 10 is fine for me.
I'm adding a comment about it in the CRT unit.
Frank