-
Notifications
You must be signed in to change notification settings - Fork 17
Simulating Keyboard Commands
Francisco Ryan Tolmasky I edited this page Oct 18, 2016
·
1 revision
Animate the typing of a string into the given window
or main page.
Attributes
- window (optional) - Specify which window to type in, or null for the main page.
const { type } = require("demokit/keyboard");
<click selector = "input[type=text]"/>
<type>Hello There!</type>
Use <br/>
for newlines when typing.
const { type, br } = require("demokit/keyboard");
<type>
Hello There!<br/>
How are you?
</type>
Immediately inserts text, as if it had been pasted by the user.
Attributes
- window (optional) - Specify which window to paste in, or null for the main page.
const { type, paste } = require("demokit/keyboard");
<type>var URL = "<paste>http://github.com/runkitdev/demokit</paste>"</type>
Types a single character code. Available character codes can be found here.
const { key } = require("demokit/keyboard");
<key code = "escape"/>