Jump to content

Simulate input/Keyboard: Difference between revisions

m
No edit summary
Line 1:
{{task|GUI}}[[Category:Testing]]{{Omit From|Modula-3}}
{{omit from|ACL2}}
Send simulated keystrokes to a GUI window, or terminal. You should specify whether the target may be externally created (i.e., if the keystrokes are going to an application other than the application that is creating them).
{{omit from|Batch File}}
{{omit from|Brainf***}}
{{omit from|Maxima}}
{{Omit From|Modula-3}}
{{omit from|PARI/GP}}
{{omit from|PHP}}
{{omit from|PostScript}}
{{omit from|R}}
{{omit from|Retro}}
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}}
{{omit from|zkl}
 
Send simulated keystrokes to a GUI window, or terminal.
You should specify whether the target may be externally created
(i.e., if the keystrokes are going to an application
other than the application that is creating them).
 
=={{header|AutoHotkey}}==
Line 14 ⟶ 30:
Send("The answer is 42")</lang>
 
It takes user input in variable using "input box" and displays that in "message box"
and displays that in "message box"
<lang AutoIt>$name="type your name here"
$name = InputBox("Name","Your name please ?",$name)
Line 378 ⟶ 395:
(prinl (value 8)) # Print the price (12.50)
(click "logout") # Log out</lang>
{{out}}
Output:
<pre>12.50</pre>
The same example is used in the related task [[Simulate input/Mouse#PicoLisp]].
Line 435 ⟶ 452:
 
=={{header|Scala}}==
[[Category:Scala Implementations]]{{libheader|Scala}}<lang scala>import java.awt.Robot
<lang scala>import java.awt.Robot
import java.awt.event.KeyEvent
 
Line 465 ⟶ 483:
{{libheader|Tk}}
 
This only works with windows created by Tk; it sends a single key "x" to the given window.
it sends a single key "x" to the given window.
<lang tcl>set key "x"
event generate $target <Key-$key></lang>
Line 476 ⟶ 495:
event generate .t [expr {$c eq " "?"<space>": $c}]
}</lang>
Note also that the task on [[Keyboard macros#Tcl|keyboard macros]] illustrates a very closely related method.
illustrates a very closely related method.
 
=={{header|VBScript}}==
Line 486 ⟶ 506:
WScript.Sleep 1000 ' one-second delay
WshShell.SendKeys "{Left}{Left}{BkSp}{BkSp}Some text here.~" ' ~ -> Enter</lang>
 
{{omit from|ACL2}}
{{omit from|Batch File}}
{{omit from|Brainf***}}
{{omit from|Maxima}}
{{omit from|PARI/GP}}
{{omit from|PHP}}
{{omit from|PostScript}}
{{omit from|R}}
{{omit from|Retro}}
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}}
{{omit from|zkl}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.