From 31e982ea2541d6aa46bcb4692d1d7ec0d89fd670 Mon Sep 17 00:00:00 2001 From: Nick Burr <135270152+itsmenickfromschool@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:50:07 -0700 Subject: [PATCH] Update keyboard.rst specified how to avoid a common hotkey bug on macOS by including the interval argument. --- docs/keyboard.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/keyboard.rst b/docs/keyboard.rst index ac46b64..520190e 100644 --- a/docs/keyboard.rst +++ b/docs/keyboard.rst @@ -95,7 +95,11 @@ To make pressing hotkeys or keyboard shortcuts convenient, the ``hotkey()`` can >>> pyautogui.keyUp('shift') >>> pyautogui.keyUp('ctrl') -To add a delay interval in between each press, pass an int or float for the ``interval`` keyword argument. +To add a delay interval in between each press, pass an int or float for the ``interval`` keyword argument. On macOS, 'command' has to be pressed before other keys in the sequence, adding in an interval will fix bugs where the keyboard shortcut wasn't succesfully run. This code to open spotlight is an example: + +.. code:: python + + >>> pyautogui.hotkey('command', 'space', interval=0.125) KEYBOARD_KEYS =============