Keyboard Actions
Keyboard Actions are actions to emulate an keyboard entry.
Keyboard Keys
Marvin is prepared to deal with function keys on your keyboard. For it you can give the key name, on any key event, as example:
keyboard.press('enter')
emulate ENTER key presskeyboard.press('tab')
emulate TAB key presskeyboard.press('shift')
emulate SHIFT key presskeyboard.press('ctrl')
emulate CONTROL key presskeyboard.press('alt')
emulate ALT key presskeyboard.press('esc')
emulate ESC key presskeyboard.press('return')
emulate RETURN key presskeyboard.press('capslock')
emulate CAPS LOCK key presskeyboard.press('up')
emulate UP ARROW key presskeyboard.press('down')
emulate DOWN ARROW key presskeyboard.press('left')
emulate LEFT ARROW key presskeyboard.press('right')
emulate RIGHT ARROW key presskeyboard.press('home')
emulate HOME key presskeyboard.press('end')
emulate END key presskeyboard.press('pagedown')
emulate PAGE DOWN key presskeyboard.press('pageup')
emulate PAGE UP key press
The same could be done with keyboard.key_up
and keyboard.key_down
actions.
Actions
keyboard.hotkey
Send a hot key combination.
Parameters:
hotkey - hot key code as string: "ctrl+c"
and "ctrl+v"
, for example.
Returns:
This action gives no return
keyboard.key_down
Emulate the key down event on keyboard. This emulate the press and hold of a key.
Parameters:
key - key to send key down event.
Returns:
This action gives no return
keyboard.key_up
Emulate the key up event on keyboard. This emulate a release of a key.
Parameters:
key - key to send key up event.
Returns:
This action gives no return
keyboard.press
Emulate a key press event on keyboard. The key press is a key down and key up event in sequence.
Parameters:
key - key to send key press event.
Returns:
This action gives no return
keyboard.type_text
Type the given text to screen, emulating a sequence of key press.
Parameters:
text - text to type
interval - interval in seconds between each key press (default=0)
On slow machines it shold be bigger than 0, to avoid fast typing problems.
Returns:
This action gives no return