- Documentation
- Client functions
- injectBrowserCharacter
Function
injectBrowserCharacter
Types text into the page's active field, character by character (keypress / input events), including accented letters and other UTF-8 characters.
Syntax
bool injectBrowserCharacter(browser webBrowser, string text)Arguments
webBrowserbrowser- The browser.
textstring- Text to type. Control characters (e.g. a newline) are skipped - send Enter with
injectBrowserKey.
Returns
true when at least one character was typed.
Example
injectBrowserCharacter(browser, "Zażółć gęślą jaźń")
injectBrowserKey(browser, "enter")
injectBrowserKey(browser, "enter", false)
See also
injectBrowserKeySends a key press or release to the page (e.g. Enter, Backspace, arrows), as if the player pressed it on the keyboard. The page gets normalkeydown/keyupevents. UseinjectBrowserCharacterto type text.focusBrowserGives the keyboard to a browser. Typing goes to the page when one of its text fields is active and the cursor is shown.nilremoves focus from all browsers.