Skip to content

Commit

Permalink
Document keyboard functions in README (fixes #29)
Browse files Browse the repository at this point in the history
  • Loading branch information
msanders committed Oct 30, 2019
1 parent 1d58f89 commit cb8ff23
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ code will cause an alert dialog to appear on every major platform:

```python
import autopy


def hello_world():
autopy.alert.alert("Hello, world")
hello_world()
Expand Down Expand Up @@ -111,6 +113,28 @@ sine_mouse_wave()

<a href="https://www.autopy.org/documentation/sine-wave"><img src="https://github.com/msanders/autopy/raw/gh-pages/sine-move-mouse-thumbnail.jpg" alt="Demonstration video"/></a>

### Controlling the Keyboard

The following will enter the keys from the string "Hello, world!" in the
currently focused input at 100 WPM:

```python
import autopy


autopy.key.type_string("Hello, world!", wpm=100)
```

Alternatively, individual keys can be entered using the following:

```python
import autopy


autopy.key.tap(autopy.key.Code.TAB, [autopy.key.Modifier.META])
autopy.key.tap("w", [autopy.key.Modifier.META])
```

### Working with Bitmaps

All of autopy's bitmap routines can be found in the module `autopy.bitmap`. A
Expand Down

0 comments on commit cb8ff23

Please sign in to comment.