asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.24k forks source link

Windows 10: Sending keypad keys are normal keys #736

Open Erriez opened 2 years ago

Erriez commented 2 years ago

I'd like to send the keypad keys + - / * and created the following example with pyautogui master hash 667161b072e89b4a25b806c5f2ca616e6c0aeec3:

import pyautogui

# Send keypad+/ -> sends normal key /
pyautogui.press('divide') 

# Send keypad+* -> sends normal key *
pyautogui.press('multiply') 

# Send keypad+- -> sends normal key -
pyautogui.press('subtract') 

# Send keypad++ -> sends normal key +
pyautogui.press('add') 

The focused Windows application receives normal keys instead of the keypad addition. How can I send keypad keys?