moses-palmer / pynput

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

keyboard.type/key.press printing gibberish after 14k characters. #365

Open Pietschnitzel opened 3 years ago

Pietschnitzel commented 3 years ago

using the keyboard.type function i first tried to print lorem ipsum sample text but after 14k characters it only printed gibberish. Is that a limit or is it something else on my end ? here is the text originally in a txt file:https://pastebin.com/WSFyFdzc and in the pynput output:https://pastebin.com/Da47HuZq TIA

moses-palmer commented 3 years ago

Thank you for your report.

Can you please provide a small sample that reproduces your issue? I just updated the issue template to include a request for that.

Pietschnitzel commented 3 years ago

This is the entire code,i hope it´s ok

from pynput.keyboard import Key, Controller
import time
import os

#variables
keyboard = Controller()
datadir = 'C:\\Users\\User\\Desktop\\Coding\\\\Python\\pynput'

os.chdir(datadir)
with open("data.txt", 'r') as file:
    data = file.read()
keyboard = Controller()
time.sleep(5) 
for word in data:
    keyboard.type(data)