• porting OS/2 to Windows

    From tholen@antispam.ham@21:1/5 to All on Sat May 21 01:52:44 2016
    What is the closest Windows API analog to the OS/2 API KbdCharIn?

    I've tried GetKeyState and GetAsyncKeyState, but in a console
    application, it seems they always return zero.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Mueller@21:1/5 to tholen@antispam.ham on Sat May 21 11:07:26 2016
    On 21.05.16 03.52, tholen@antispam.ham wrote:
    What is the closest Windows API analog to the OS/2 API KbdCharIn?

    I've tried GetKeyState and GetAsyncKeyState, but in a console
    application, it seems they always return zero.

    The console API in Win is distinct from the GUI API. ReadConsoleInput/PeekConsoleInput might be your friends.


    Marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tholen@antispam.ham@21:1/5 to Marcel Mueller on Tue Jun 28 04:25:52 2016
    Marcel Mueller writes:

    What is the closest Windows API analog to the OS/2 API KbdCharIn?

    I've tried GetKeyState and GetAsyncKeyState, but in a console
    application, it seems they always return zero.

    The console API in Win is distinct from the GUI API.

    I am aware that console apps differ from GUI apps in that the latter
    need to process a message queue. But it would be incorrect to say
    that console apps are restricted to console APIs. For example, I've
    written a console app that calls the PlaySound API. So I would expect
    that APIs could be used as long as they don't deal with a message queue,
    and I don't recall seeing anything along those lines in the documentation
    for GetKeyState. The test program I wrote that calls these APIs certainly compiles, links, and runs, but it just doesn't behave the way I expected.

    ReadConsoleInput/PeekConsoleInput might be your friends.

    One of these days I'll need to give them a try, but I've had zero time
    for this programming project the last few weeks. It's important to have
    the capability to both block and not block, which GetKeyState and GetAsyncKeyState seemed to offer. I still haven't figured out why they
    always returned zero.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)