X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_THREADED,SPF_HELO_PASS,TW_KB,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <501C525C.6000604@dancol.org> Date: Fri, 03 Aug 2012 15:36:12 -0700 From: Daniel Colascione User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: kbhit() in a native app run from CYGWIN console does not work? References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1C7D41EFE91B92B5A5FBF7B6" X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------enig1C7D41EFE91B92B5A5FBF7B6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 8/3/2012 3:33 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: > Hi All, >=20 > I have a native Windows app that is run from bash (which is in turn run > in a standard Cygwin terminal window, mintty). The application's code us= es > kbhit() to check whether input is available from the user -- but it looks > like kbhit() never indicates any input (when keys are getting pressed). > The app works just fine if started directly from CMD.EXE. >=20 > Is that the expected behavior? mintty is not a real Windows console, so programs that try to access the co= nsole directly (like your kbhit-using program) won't work. Try running your progr= am under the "conin" program, or run bash inside a console window. --------------enig1C7D41EFE91B92B5A5FBF7B6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAcUlwACgkQ17c2LVA10VsP4ACgz8fVflEd+ApSrX3deb27RNbP HM0An3W73z6mNtVfFULgV5VLu0bDF7Up =ZUr3 -----END PGP SIGNATURE----- --------------enig1C7D41EFE91B92B5A5FBF7B6--