K
K
KarToSHKa_Ex2020-07-27 03:15:05
Python
KarToSHKa_Ex, 2020-07-27 03:15:05

How to simulate a keypress?

There is a code that should hold shift and W. Regarding Shift, it clamps and it can be seen, but it does not clamp the W key, but simply presses it once. How can I fix this and is it even possible? I do not need many clicks, namely pinching
Here is the code:

pyautogui.keyDown('shift')
    pyautogui.keyDown('W')
    time.sleep(10)
    pyautogui.keyUp('w')
    pyautogui.keyUp('shift')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nubrik, 2020-07-30
@nubrik

You need to run the following:
pyautogui.press(['shift', 'W'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question