program buffer or a keyboard buffer

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

program buffer or a keyboard buffer

Post by Otto »

Hello,

I try to find out how I can read a keyboard buffer.

This is what I found so far. Can someone help me to with a fivewin solution.
so if there is a command line and there is a text in it and waiting for an 'enter' to be pressed in which buffer does it stay?,in a program buffer or a keyboard buffer?

It depends on the platform, but for example on a .NET console app running on Windows, if you call Console.ReadLine() while the app has focus it is going to receive the keyboard input and store it in an application level buffer. The only time it would stay at a lower level buffer is if the system is too busy to process the input in time. At this level 'buffering' is really just a semantic concept; the system is basically at rest, the input has been processed, transformed into a UTF-8 string and stored in memory waiting to be returned to your program when the enter key is detected.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: program buffer or a keyboard buffer

Post by Antonio Linares »

Otto,

keyboard pressed chars will automatically arrive to the app as Windows messages, so there is no need to access the keyboard buffer.

In case that you want to check in advanced (before those messages come to you) what is there is the buffer you can use PeekMessage()

https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply