How do I get pynput to work?
its work try this
import os
os.system("pip install pynput")
then type for mouse
from pynput.mouse import Button, Controller
mouse = Controller()
@Hariveera Thanks! I don't really need it any more but it might come in handy some time.
I had to pip install xlib then pip3 install pynput for it to work, and I wasn't even using replit. It's doubtful that a browser environment will ever be able to use this module.
@AnthonyFerr I think so to. But still, there could be a way but I'm doubtful there is.
i think its due to not having a screen try useing pygame not python
@Nettakrim can pygame press keys?
for keyboard
from pynput.keyboard import Key, Controller
keyboard = Controller()
I have the same question. ^^
@Lucas_Williams IDK but I do think using the pygame language will work.
@TurtleAndrew I tried it out and it didn't seem to work, https://repl.it/@Lucas_Williams/KeyPresser-Retry#main.py
@Lucas_Williams In that case, it might just not work on repl. If you tell me what your trying to do with it, I might be able to tell you a different way to do it or a different package to use.
@TurtleAndrew I’m trying to have a program force me to type letters. So I start it type in a letter and a number and wherever my cursor is it types that character however many times I set it to. I tried it on python on my PC and i can get it to work was just hoping it would work on repl as well.
@Lucas_Williams Ok, I just don't think pynput will work on repl.
Try this:
Works great, thanks!
I tried it and it doesn't work. Do you have any other suggestions?
@IanTang2 I'm not sure how to get it working. I mostly just selected that as the answer because I no longer needed to use pyinput on replit. Although if I'm remembering correctly I might have gotten it working using that a few months ago for a school project but I'm not entirely sure.