pynput icon indicating copy to clipboard operation
pynput copied to clipboard

After the screen is locked, the string is printed to the back of the screen

Open 21pages opened this issue 2 years ago • 0 comments

Description

As the title says, the correct password cannot be entered via the remote control after the screen is locked because the string is entered behind the screen

Platform and pynput version Platform: xubuntu 20.04 pynput: 1.7.6

To Reproduce code:

from pynput.keyboard import Key,Controller
import time

print("start")
keyboard = Controller()

def loop():
    global keyboard
    while True:
        keyboard.tap("a")
        keyboard.tap(Key.space)
        keyboard.tap("1")
        keyboard.tap(Key.down)
        print("\n")
        time.sleep(5)
loop()

Run this code, then lock the screen, and find that "1" and "a" cannot be automatically entered into the password box, only spaces are entered. After unlocking the screen, the terminal displays as follows:

a 1^[[B

a 1^[[B

a 1^[[B

a 1^[[B

a1

a 1^[[B

a 1^[[B

a 1^[[B

21pages avatar Mar 12 '22 02:03 21pages