Skip to content

key ​

The supported key codes are:

  • Letters: a–z (case-insensitive)
  • Digits: 0–9
  • Function keys: F1–F12
  • Modifiers: Shift, Control, Alt, Meta
  • Editing: Enter, Backspace, Tab, Space (also accepts " ")
  • Navigation: ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Escape
  • iOS buttons: Home, Power, volume+, volume-
  • Symbols: -, =, [, ], \, ;, ', `, ,, ., / and their shifted forms

Unknown key codes raise ValueError.

TIP

key.click() automatically handles uppercase letters and shifted symbols. For key.down() / key.up(), hold Shift explicitly.

key.click() ​

Press and release a key.

python
key.click(code: str) -> None

Arguments ​

NameTypeDefaultDescription
codestrThe key code.

Return ​

None.

Example ​

python
from catscript import key

if __name__ == "__main__":
    key.click("Home")

key.down() ​

Press and hold a key.

python
key.down(code: str) -> None

Arguments ​

NameTypeDefaultDescription
codestrThe key code.

Return ​

None.

Example ​

python
import time
from catscript import key

if __name__ == "__main__":
    key.down("Home")
    time.sleep(0.1)
    key.up("Home")

key.up() ​

Release a key.

python
key.up(code: str) -> None

Arguments ​

NameTypeDefaultDescription
codestrThe key code.

Return ​

None.

Example ​

python
import time
from catscript import key

if __name__ == "__main__":
    key.down("Home")
    time.sleep(0.1)
    key.up("Home")

Python automation for jailbroken iOS