Simulate input/Keyboard: Difference between revisions

Line 330:
=={{header|Perl}}==
Perl on linux can do this for PseudoTerminals (ptys) and Terminals (ttys) using [http://www.kernel.org/doc/man-pages/online/pages/man4/tty_ioctl.4.html IOCTL TIOCSTI]. The same can be done with C or any other language that can use IOCTL either natively or via [http://en.wikipedia.org/wiki/Foreign_function_interface FFI] such as [http://en.wikipedia.org/wiki/Java_Native_Interface JNI] or [http://en.wikipedia.org/wiki/Java_Native_Access JNA].
 
Target may be externally created, but process must be able to open tty/pty for writing.
 
<lang perl>$target = "/dev/pts/51";
Line 343 ⟶ 345:
 
Perl on Windows can do this using the SendKeys function from [http://search.cpan.org/%7ekarasik/Win32-GuiTest-1.58/lib/Win32/GuiTest.pm Win32::GUITest]
 
Target may be externally created.
 
<lang perl>SendKeys("Hello, how are you?\n");</lang>
54

edits