comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Get_Immediate does not read CR in CRLF pairs
Date: Wed, 9 Mar 2022 13:54:03 +0100	[thread overview]
Message-ID: <t0a81b$bnn$1@gioia.aioe.org> (raw)
In-Reply-To: c9a3d847-057f-4c20-9283-57adeaf65374n@googlegroups.com

On 2022-03-09 12:26, Marius Amado-Alves wrote:
> On Tuesday, 8 March 2022 at 12:53:17 UTC, Dmitry A. Kazakov wrote:
>> On 2022-03-08 13:20, Marius Amado-Alves wrote:
>>> Text_IO should just get the character from the OS. Without assumptions that it is this or that key.
>> That is technically impossible under Windows. Windows does not deal with
>> characters it does with scan codes which then might be converted to
>> characters this or that way, or not at all.
> 
> You mean Text_IO scans the keyboard?!

Of course not, usually you have no direct access to it.

Specifically GNAT's Text_IO implementation under Windows seems to use 
Microsoft's getch from the C run-time:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/getch-getwch?view=msvc-170

So all translation happens in the layer emulating file descriptors on 
top of Windows I/O system; on top of whatever sits below, console driver 
etc.

Interestingly getch let you access some actual scan codes as follows 
from the description. Though of course you get them only if you deal 
with an actual console and not with a pipe etc.

The point is that "character" is a fiction unless you read a modem line 
and even then.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

      reply	other threads:[~2022-03-09 12:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  7:45 Get_Immediate does not read CR in CRLF pairs Marius Amado-Alves
2022-03-08  7:46 ` Luke A. Guest
2022-03-08 12:08   ` Marius Amado-Alves
2022-03-08 14:57     ` Luke A. Guest
2022-03-08 16:43       ` Marius Amado-Alves
2022-03-08 17:21         ` Dennis Lee Bieber
2022-03-08 17:26         ` Dennis Lee Bieber
2022-03-09  9:11         ` Luke A. Guest
2022-03-08  8:03 ` Dmitry A. Kazakov
2022-03-08  9:06 ` Jeffrey R.Carter
2022-03-08 12:20   ` Marius Amado-Alves
2022-03-08 12:53     ` Dmitry A. Kazakov
2022-03-09 11:26       ` Marius Amado-Alves
2022-03-09 12:54         ` Dmitry A. Kazakov [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox