Skip to content
disfated edited this page Apr 16, 2011 · 1 revision

Keyboard abstraction layer.

Common

  • To specify several keys join them with "+": "ctrl+a".

  • Keycodes are case-insensitive.

    TODO: Key codes...

Supported platforms:

  • Windows - supported (requires: pywin32);

  • Unix - supported (requires: Xlib);

  • Mac - not supported (requires: );

Examples

from libs import keyboard as key

key.press('plus')
key.press('minus')
key.press('f1')
key.press('ctrl+alt+del')

API

  • keyboard.down(keys)
    Press down given keyboard keys.
    Returns self.

  • keyboard.up(keys)
    Release given keyboard keys.
    Returns self.

  • keyboard.press(keys)
    Press (press down & release) given keyboard keys.
    Returns self.

  • keyboard.sleep(seconds)
    Just a handy clone of standart time.sleep() for cozy chaining.
    Returns self.