delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/03/03:53:32

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=2.1 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_JMF_BL,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Date: Fri, 3 Sep 2010 09:53:12 +0200
From: Peter =?utf-8?Q?M=C3=BCnster?= <pmlists AT free DOT fr>
To: cygwin AT cygwin DOT com
Subject: Re: simulating console input
Message-ID: <20100903075312.GA18543@gaston.couberia.bzh>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20100902074703 DOT GA11464 AT gaston DOT couberia DOT bzh> <4C7FC3B4 DOT 1060606 AT cygwin DOT com>
MIME-Version: 1.0
In-Reply-To: <4C7FC3B4.1060606@cygwin.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Thu, Sep 02 2010, Larry Hall (Cygwin) wrote:

> >How could I simulate the "Y" keypress?
> >
> >"echo Y | DosProgram.exe" does not work...
> >
> >The keypress is accepted only in a dos-console.
> 
> Read <http://cygwin.com/cygwin-ug-net/using-effectively.html#using-console>.
> Then add this fact - the SSH server uses ptys.  So your program will not
> work with a single character put in the input buffer.  One could
> envision using 'yes' to fill the buffer of the pipe that the Windows program
> interprets the pty to be.  Perhaps a nicer alternative is to build the
> problematic program with Cygwin, if that's an option, so that it will
> understand the pty.

Unfortunately, I don't have the source code of the program, so it's no option
to patch it.

I tested mintty: it does not work.

I understand, that there is nothing to do with a pipe to the pty or stdin.

I'm thinking of something like this:

ConsoleKeypressSimulator.exe --delay 10 --key y &
DosProgram.exe

And for proper operation, the DosProgram needs a "y" keypress about 10 seconds
after begin of execution.

So my questions are:
- Is it possible to write such a program: ConsoleKeypressSimulator.exe ?
- If yes, what is the degree of difficulty to write that?

Thanks for your help!
Peter

-- 
Contact information: http://pmrb.free.fr/contact/



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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