A simple Automata could be added to and Application to inject keystrokes, to a two port system.
A simple Play Script could be read by the Automata and inject keystrokes as if typed by the user or received from the remote end.
< Hello How and I help?
> I would like to order a widget holder
< what size would you like?
Each line would be directed to be injected at the interface.
< interface is from the far end
> interface is from the near end.
A method to start it and stop it would be needed.
Each character in the line above would be typed as if typed by a real person.
It can be used to soak test the Application and try out different ideas.
Code in my Webpage could be used.
http://www.dougrice.plus.com/dev/DigiSpark/text2.html
It uses a timer to run a time slice.
Real time is incremented in parallel and when it over flows a character in injected at the correct interface.
http://www.dougrice.plus.com/hp/Theory/cg6.htm shows the Catch Up Call Generator. This can be used for multiple sources all clocked from one timer.
It has been possible to use cscript to press keys but there is very little control.
once started, you need to wait for the script to end.
http://www.dougrice.plus.com/dev/DigiSpark/How_app.js.txt
/* * * * How_app.js - Key Pressing script, based on one to automate the EUA * * Automating typing into the App using Windows shell scripts and javascript.* * * https://msdn.microsoft.com/en-us/library/8c6yea83(v=vs.84).aspx * https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/windows-scripting/8c6yea83(v=vs.84) * * wscript How_app.js /*
http://www.dougrice.plus.com/dev/DigiSpark/How_app_Tests.js.txt
Java robot provides a way to drive the keyboard and mouse. It can also sample the screen.
It is not possible to ask where a window is on the screen.
http://www.dougrice.plus.com/dev/javaTries/euan.java.txt
A count down state machine uses a state variable that is decremented each timeslice.
It can be triggered and a periodic time slice is used to animate it. At the end it can disable itself.
The count can be adjusted depending on inputs.
Functions:-
trigger() timeslice()
Example:- A chiming clock needs to strike the hours.
A weight provides power to run the count down state machine.
trigger() sets countdown to number of bongs required.
timeslice() is run every second.
if countdown is greater than 0 decrement and strike bell if countdown is zero signal end and disable.
Example:- A monostable that flashes a sequence
trigger() sets countdown to number of flashes required, and loads pattern required.
timeslice() is run every second.
if countdown is greater than 0 decrement and flash LED. Maybe a pattern is used if countdown is zero signal end and disable.