delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/27/09:40:44

Date: Sun, 27 Dec 1998 16:40:27 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Blasczyk <byk AT eikon DOT tum DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: Redirectable Keyboardinput
In-Reply-To: <765bu5$3k3$1@sparcserver.lrz-muenchen.de>
Message-ID: <Pine.SUN.3.91.981227163854.3529A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Sun, 27 Dec 1998, Martin Blasczyk wrote:

> if (kbhit()!=0) c=getkey();
> 
> It works, but it isn't redirectable. If I for example do a 'ctty com1' the
> routine wants the key to be pressed on the keyboard, not on the terminal
> conected to com1. Could You give me a hint?

Use the library function `select', it works with handles and so supports 
redirection.  (It is also more portable to Unix machines, while kbhit is 
DOS-specific.)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019