This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _kbhit

At 18:58 2006-02-10 -0500, Michiel de Hoon wrote:
>> On Sun, Feb 05, 2006 at 01:17:33PM -0500, Michiel De Hoon wrote:
>> >For one of my software projects, I need the _kbhit function to check the
>> >console for keyboard input. While this function is present in msvcrt.dll,
>> >is missing from cygwin1.dll, so I started writing this function myself
>> >hoping to contribute it to Cygwin if it works well).
>> I really appreciate the sentiment of submitting code but _kbhit is not a
>> linux function (or <echo on>POSIX, POSIX, POSIX...</echo off>) so it
>> really isn't a candidate for inclusion in the Cygwin DLL.
>> cgf
>Even though _kbhit is not a POSIX function, I think a valid argument can be
>made to include it in Cygwin anyway.
>First, some Cygwin programs will need this function to be able to interact
>with the Windows OS. Second, as the Cygwin DLL is a replacement for msvcrt
>(and msvcrt.dll and cygwin1.dll cannot be used together), [snip]

I cannot confirm your assertion that msvcrt.dll and cygwin1.dll cannot be
together. If I compile the attached (almost C) file that dynamically links to 
msvcrt.dll using Cygwin:
	gcc -o kbhit.exe kbhit.cpp
it compiles, links and works (on CMD and bash on CMD but not on rxvt; as 
stated elsewhere in this thread the Microsoft _kbhit is not very good).


Arend-Jan Westhoff.

Attachment: kbhit.cpp
Description: Text document

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]