Re: [R] TR: Simulate keyboard

From: Thibault Charles <thibault.charles_at_solamen.fr>
Date: Mon, 16 May 2011 13:50:15 +0200

Thank you for your response.

In this case, do you think it is possible to write a little program in java which would execute my script and simulate a press on my keyboard ?

If yes, does anybody experiment it and could give me some help or advice ?

Thanks,

Thibault Charles
Solamen
Audencia - 8 route de la Jonelière
44300 Nantes
+33 2 40 37 46 76

-----Message d'origine-----
De : r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] De la part de Philipp Pagel
Envoyé : lundi 16 mai 2011 12:29
À : r-help_at_r-project.org
Objet : Re: [R] TR: Simulate keyboard

On Mon, May 16, 2011 at 11:27:05AM +0200, Thibault Charles wrote:
> I cannot find a way to simulate a keyboard event as pressing the ?enter?
> key.
> for (i in 1:nombre_fichiers_monteCarlo){
>
system(paste('"C:/Trnsys17/Exe/TRNExe.exe"',liste_dck_monteCarlo[i]),wait=TR UE)
> }
>
> My problem is that at each step, trnsys ask the user to press ?enter? from
> the keyboard and I would like not have to press myself on ?enter?.
>
> Does exist a function to simulate this kind of keyboard event ?

I don't think R can handle that (but I may be wrong). On a UNIX platform, this kind of problem could be tackled with the expect command.

Your code above suggests you are on a Windows platform. I did a quick google search and it seems that expect is available for windows as part of the CYGWIN suite. And there also seems to be an expect for windows from activestate:

http://docs.activestate.com/activetcl/8.5/expect4win/

cu

        Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
Maximus-von-Imhof-Forum 3
85354 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 16 May 2011 - 11:55:03 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 16 May 2011 - 17:20:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive