Forum > Windows

Console Application

<< < (2/2)

Fred vS:
Hello.

If you want to access keyboard on console application, you may have more luck using "keyboard" unit vs "crt" unit.

See here: https://forum.lazarus.freepascal.org/index.php/topic,57284.msg426272.html#msg426272

[EDIT] Of course, you should adapt (or remove) the const CHARS with your desire.

Fre;D

jcmontherock:
Thanks a lot.  :D
It solves my problem with Crt.pp.

Bart:

--- Quote from: jcmontherock on December 30, 2021, 11:12:50 am ---Finally, I found what it happen: it's coming from the unit Crt.pp. I did not found the error, in that unit.

--- End quote ---

Crt unit has 2 procedures that influence what it does when it writes to console (by default it will reset the consoles codepage on each write to the default value): SetSafeCPSwitching() and  SetUseACP(), both procedures take a boolean as their parameter.
Just play around with these 2 (only 4 possible combinations, I'm too lazy to test).

Bart

Navigation

[0] Message Index

[*] Previous page

Go to full version