moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.77k stars 245 forks source link

Cannot enter password when screen locks #461

Closed rustdesk closed 2 years ago

rustdesk commented 2 years ago

Description Cannot enter password when screen locks. Looks like below get wrong focus input. https://github.com/moses-palmer/pynput/blob/master/lib/pynput/keyboard/_xorg.py#L292

Platform and pynput version Latest version, on Ubuntu 18, Fedora 28.

To Reproduce Run below, then lock screen and go to password input window.

from pynput.keyboard import Controller
import time

keyboard = Controller()

while True:
  keyboard.press('A')
  keyboard.release('A')
  time.sleep(3)
moses-palmer commented 2 years ago

Thank you for your report.

I will close this as a duplicate of #459.