Skip to content

Commit

Permalink
Describe how to escape modifiers in type_keys(), mention method .set_…
Browse files Browse the repository at this point in the history
…edit_text() in Remote Execution Guide.
  • Loading branch information
vasily-v-ryabov committed Feb 10, 2019
1 parent fabc0fc commit 734a3cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/remote_execution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ There are few methods for silent text input in ``backend="win32"``:
.. _`send_chars`: code/pywinauto.controls.hwndwrapper.html#pywinauto.controls.hwndwrapper.HwndWrapper.send_chars
.. _`send_keystrokes`: code/pywinauto.controls.hwndwrapper.html#pywinauto.controls.hwndwrapper.HwndWrapper.send_keystrokes

There is another useful method to enter string at once (available for both backends, usually for edit box only):

* `"uia": set_edit_text`_ (enter text as is, no modifiers supported)
* `"win32": set_edit_text`_

.. _`"uia": set_edit_text`: code/pywinauto.controls.uia_controls.html#pywinauto.controls.uia_controls.EditWrapper.set_edit_text
.. _`"win32": set_edit_text`: code/pywinauto.controls.win32_controls.html#pywinauto.controls.win32_controls.EditWrapper.set_edit_text


Start remote script using agent based CI
----------------------------------------

Expand Down
5 changes: 5 additions & 0 deletions pywinauto/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
"{h up}"
"{e up}"
"llo") # to type hello
Use curly brackers to escape modifiers and type reserved symbols as single keys: ::
send_keys('{^}a{^}c{%}') # type string "^a^c%" (Ctrl will not be pressed)
send_keys('{{}ENTER{}}') # type string "{ENTER}" without pressing Enter key
"""
from __future__ import unicode_literals

Expand Down

0 comments on commit 734a3cc

Please sign in to comment.