Keyboard
Keyboard module for autopylot.This module contains functions for keyboard input and output.
Examples:
>>> from autopylot import keyboard
>>> keyboard.press(key_1='a')
>>> keyboard.write(text='Hello World!')
>>> keyboard.write(text='Hello World!', end='enter')
>>> keyboard.hit_enter(window="Notepad")
This module contains the following functions:
press(key_1, key_2, key_3, window)
: Check if a key is pressed.write(text, window, end)
: Write text and press enter.hit_enter(window)
: Press enter.
hit_enter(window='')
press(key_1, key_2='', key_3='', window='')
Press a key or a combination of keys.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key_1 |
str
|
The first key to press. |
required |
key_2 |
str
|
The second key to press. |
''
|
key_3 |
str
|
The third key to press. |
''
|
window |
str
|
The window to press the key in. Defaults to Active Window. |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples:
write(text, window='', end='enter')
Write text to window and press enter key
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str
|
Text to write |
required |
window |
str
|
The window to write to. Defaults to Active window |
''
|
end |
str
|
Key to press at end. Available options are 'enter', 'tab'. |
'enter'
|
Returns:
Type | Description |
---|---|
None
|
None |
Examples: