Dude literally nowhere else explained why pyautogui doesn't work sometimes. You are my hero. Literally I'm so glad I finally found this.
@LearnCodeByGaming4 жыл бұрын
Glad to help!
@luigiesposito24812 жыл бұрын
@@LearnCodeByGaming hello friend please Luigi I'm Italian I don't understand English would you give me a hand? to install the program?
@maybelindow39062 жыл бұрын
@@luigiesposito2481 hi did you use Google translate to type that ( out of curiosity 👀 )
@ninjedi6710 Жыл бұрын
@@LearnCodeByGaming what would be a recommended approach to record mouse movements in FPS games? im having a problem where the script thinks that the mouse is always at the center of the screen.
@yoursps Жыл бұрын
@@ninjedi6710 Faced with a similar problem. The cursor coordinates are determined centered (x=960, y=540), but the application reads them as (0, 0). This would not be a problem, but move(0, 0) transmits some wrong signal and activates the camera movement. Due to an error with zero translation in coordinates, the camera can only move diagonally. If you have a similar problem and you have found a solution, I would be grateful if you let me know.
@emiryassin8774 жыл бұрын
I got bored of playing games “the normal way” and I wanted to automate the boring stuff . Suddenly stumbled upon one of your videos one day , now i’m learning python (day 6)
@LearnCodeByGaming4 жыл бұрын
Awesome, have fun!
@deadpopcorn85232 жыл бұрын
@@LearnCodeByGaming pydirectinput kind of skips the duration function, please can you fix it????? my god it took forever to find what was wrong
@benjaminwilliams51164 жыл бұрын
You are the greatest human ever.
@LearnCodeByGaming4 жыл бұрын
lol, thanks!
@TheAmazingXizde4 жыл бұрын
DANG DUDE IT WORKS, TY SO MUCH!
@mrweb90873 жыл бұрын
In Windows 8.1 pyautogui.keyDown('alt') pyautogui.keypress('tab') Time.sleep(1) pyautogui.keyUp('alt') This is not working for switching the windows Please help me to solve this problem I also try hotkey Please tell me the solution if anyone knows 🙏🙏
@lorenzo14793 жыл бұрын
@@mrweb9087 try pyautogui.hotkey(‘alt’, ‘tab’) function, it works, I use it since hotkey isn’t implemented in pydirectinput
@mrweb90873 жыл бұрын
@@lorenzo1479 thanks✨
@jeremytwomey71674 жыл бұрын
Dude you are awesome! I spent a couple weeks wracking my brain on how to improve my simple bots and this was exactly what I needed! Keep up the good work.
@Med_Sel4 жыл бұрын
ty so much man i had to do press and hold for an amount of time before and now the presses=number of presses works which saved me a lot of lines
@LearnCodeByGaming4 жыл бұрын
Awesome, glad to help!
@Spee2k124 жыл бұрын
YES! Thank you! This has made my Factorio repetitive task application/script work perfectly, you sir are a star, I shall be following you from now on!
@cavalfou Жыл бұрын
automating in an automation game, genius XD ... though it does not work in some steam game still.
@hourz4 жыл бұрын
For anyone that still has problems try the following: 1)- Open CMD as Administrator 2) - Open game up as administrator 3) - Run the py file 4) - focus on the game window, and watch the magic happen. Hope this helped :) (please don't make spamming/scamming chat bots thats not cool man)
@joseaugustodossantossilva11494 жыл бұрын
still not working
@krikukiks4 жыл бұрын
Worked for me. It also worked when I ran my IDE (PyCharm) as administrator.
@Sergey-xf9gw4 жыл бұрын
Thank you so much I already wanted to give up on finding libraries. You're the best
@bakugameplays3 жыл бұрын
Ty king
@aamirnafis41393 жыл бұрын
i wanr to spam myself previously not working now a 2nd chance
@doubleHLabs4 жыл бұрын
This is awesome. I installed it with pip in pyCharm and tested it out. Worked first try. Now to start automating!
@LearnCodeByGaming4 жыл бұрын
Glad to hear it!
@zxdvbvzdfbzdfgdg5 ай бұрын
Our saviour! I've been trying to set up a simple macro to automate video games so when I'm not able to play I can run my macro on a raspberry pi. While in my attempt to do this I noticed that mouse interactions would only work if I was moving the mouse around. Thank you so much!
@how2eatanapple9754 жыл бұрын
Dude thank you so much! Now I can create my evil robot of destruction in minecraft. The cost will be many lives because of this. You have given me... ULTIMATE POWER!! Seriously thanks I was stuck! Edit: also there is not a hotkey command but I can just use keyDown and keyUp fine
@LearnCodeByGaming4 жыл бұрын
Haha, glad to help! Yeah it doesn't have any other way to do key combos right now.
@deadpopcorn85232 жыл бұрын
@@LearnCodeByGaming i play a 3d game called "planet of cubes" i havent tested it on other 3d games but any clicking command from pydirectinput is read as holding, but when i open my inventory its all good. My theory is that is outdated
@Limofeus3 жыл бұрын
Thanks a lot! I have a long story with this, so this was incredibly useful for me! I have tried to create simple macros for some video games about a year ago and i have tried a lot of different macro applications, different input libraries for python and NONE of them worked for any game, but what was even stranger to me is that all the inputs worked for in-game chat or any other text boxes. So i thought that all the inputs i was sending DO work, but for so little amount of time that the game could only handle them with text boxes. And this led me to spending hours and hours trying to figure out why the librarys can't hold keys but only press them for so little. And only now i found this incredibly simple, but amazingly useful video. Thank you a lot once again!
@psmith55733 жыл бұрын
I liked 20+ on the comments to express my emotion to this effort. The world is better with the people like you!
@yarx19223 жыл бұрын
New to python, and this tutorial is very easy and very helpful. Thank you very much!
@recepciftci26423 жыл бұрын
After all this struggle with not using pyautogui or similar libraries in the game, your solution worked. Thank you so much. You are great man.
@arescharles16749 ай бұрын
click api is not working, did u use this api?
@universe65784 жыл бұрын
whoa thank you so much i was struggle with this for fkn *4 hours*
@LearnCodeByGaming4 жыл бұрын
Glad to help!
@ZackDaQuack3 жыл бұрын
It took me 5 hours
@Wavened4 жыл бұрын
You prevented me from getting a migraine, thank you so much!
@laniakea81472 жыл бұрын
Thanks to this movie, I succeeded to automate “Lightning Dodger” that is famous extremely-hard side quest of Final Fantasy X. ありがとう😊
@AyaanKumar-mo7fx Жыл бұрын
Genuinely thank you so much! I had been trying to fix an issue for ages and nowhere else said why pyautogui wasn't working
@raulalejandrofuentesblanco89752 жыл бұрын
To anyone who is having problems because your code only runs the first time, be sure that you are also doing a keyUp when your doing a keyDown.
@SimonPrefontaineGames4 жыл бұрын
You just saved me a lot of headache! Thank you :)
@anmolsaxena38323 жыл бұрын
Found no other video that solves this problem . Thank u very much
@LearnCodeByGaming3 жыл бұрын
Glad it works for you
@Gamebito3 жыл бұрын
Thanks! Discord wasn't recognizing any custom keybinds I set (in the discord settings) when using pyautogui, but using your pydirectinput works!
@hotz55893 жыл бұрын
Idk if you still read through this but THANKS. I always had problem with keyboard input and this library just WORKS. Thank you so much
@JamBear4 жыл бұрын
You seem like a genuinely nice guy.
@LearnCodeByGaming4 жыл бұрын
Thanks, I try to be!
@whxmpy562 жыл бұрын
BRO I M GOING TO CRY THANK YOU SOOOO MUCH YOU ARE A LIFE SAVER.
@n.m.danimations58543 жыл бұрын
With pydirect input i keep getting the error no module called pydirectinput?
@Alexandurs4 жыл бұрын
You should have more subscribers sir, your content is top-notch.
@yasam37802 жыл бұрын
How can I perform a click action while a directx game is running? I tried pyautogui, pydirectinput, pywinauto, autoit. None of the above modules were able to click anywhere on the both game or desktop or browser while the directx game is running.
@zuccthe4thttv8874 жыл бұрын
Thanks man! youve earned your 1000th sub!
@LearnCodeByGaming4 жыл бұрын
Thanks!!!
@Vse83114 жыл бұрын
Thx for creating pydirectinput. Its working great!
@paulonascimento34613 жыл бұрын
Dude you're the best human in the world, you just save a brazilian life and time.
@decqyd3 жыл бұрын
do you know how i can get the mouse functions to work with looking around minecraft bedrock? ive tried using both pyautogui and pydirectinput but they dont seem to work
@kavikanaveli83483 жыл бұрын
have you found a solution?
@suleyk40634 жыл бұрын
I have a question. Your library seems to work with the game Rainbow Six Siege, but the mouse movement is erratic no matter what values I put for the movement. Do you know why this might be the case? I think it might have to do with the game grabbing the mouse to the screen. I'm not sure how to go about a work-around.
@patta32133 жыл бұрын
First of all: Great Work!! But I would like to ask you if there is a way to send keystrokes to an inactive window with a handle or something, so I can use this in background.
@LearnCodeByGaming3 жыл бұрын
Hi thanks! I'm working on a video about that right now actually. Should be out in about a week.
@kvnei3 жыл бұрын
I have the same question, really looking forward to your video!
@kvnei3 жыл бұрын
do you mind to share the basic idea so that I can try it first?
@stead2767 Жыл бұрын
@@LearnCodeByGaming hi teacher~~~where can I find the tutor viedo you makes~~~thank~~very a lot !!!
@joethumbsup52663 жыл бұрын
man, you're awesome! i admire you professionalism!
@tobagheorgheirinel7034 жыл бұрын
One of the best video again mate👍👍👍
@LearnCodeByGaming4 жыл бұрын
Thanks as always!
@SRFxVideos4 жыл бұрын
BROOO! YOUR LIB IS WORKING! GOOD JOB!!!! THANK YOU! Just launch your scripts with Administrator.
@LearnCodeByGaming4 жыл бұрын
Glad you got it working!
@jimmysaxblack11 ай бұрын
thanks mate i have an issue with pyautogui locate image center work on asus not HP any leads ?
@splinterun90054 жыл бұрын
I tried this library for fallout:new vegas which is a directx 9 game, as well as running the script from an administrator command prompt, however no mouse movements or keyboard inputs would work. Do you know anything else that would work?
@MushBeck_Goat Жыл бұрын
Hello, I tried to create a BOT in python for my game in LDPLAYER 9 (an Android emulator), but pyautogui and pydirect work on my windows but not on my emulator how to solve this probleme?
@ipratik914 жыл бұрын
I am using pyautogui with opencv to make a bot for a game. Problem is want the program to keep taking screenshots till it finds a button that I want pressed and only then move forward. I tried if loop but pyautogui is not returning none or ImageNotFound. It's returning something else only if it doesn't find the image. Can u help?
@LearnCodeByGaming4 жыл бұрын
What is locate() returning? And are you using the confidence parameter? If you want to share your code with me on pastebin.com I can diagnose the problem faster.
@greedsloth15164 жыл бұрын
Thank you Ben! I am almost sure but i just had to ask are you a developer by career?
@LearnCodeByGaming4 жыл бұрын
I am! I've been doing it for 12 years, and since last year I've been working as an independent consultant.
@k15e15 Жыл бұрын
Thank you!! You're a genius!! I'm from Russia. I have been looking for a solution to the problem for a long time and there was no information about it. But I came across your video! I've stumbled upon gold!! thank you very much for making such an addition to the library!!! You're the best! Subscribe and like! You deserve more!
@aamirnafis41393 жыл бұрын
mansood bhai tum bhuut accha kaam kartteh ho
@VabrinBR3 жыл бұрын
I was trying to do it at PUBG Lite just for test and doesn't work, any suggestion?
@kasoa.thourcans1243 жыл бұрын
You're a genius, my hero, thank you so much, it works perfectly
@rafaelap.6193 Жыл бұрын
Muito obrigado, passei horas tentando arrumar isso e não achava solução em lugar nenhum, estava nas ultimas tentativas antes de desistir.
@ericsein Жыл бұрын
Bom dia, ainda funciona pra voce? pra mim ainda não funciona... Pode me dizer por favor qual foi a solução?
@Lea-ww9hf2 жыл бұрын
Hello I have a problem, when I press a key, it don't work ingame, but when I try it in a notepad it work. I used pyautogui and pydirectinput. Neither worked
@lyricsms54483 жыл бұрын
I love these videos but i wanted to ask you a question you might know a lot about. So I know that some people say that programs or anti cheats can detect a program using code to send keystrokes or button presses. What makes clicking the mouse button yourself over just having a program do it? Like is it true it's really more detectable that way?
@camvel869 Жыл бұрын
A big shout out to you in 2023! Thanks for helping me keep building a solution to use a coin acceptor over arduino. As my arduino can definitely not be flashed to hid so that it sends direct keyboard presses, I linked it to python where I ask it to send a key press that should insert a coin credit in mame. Problem is that the default keyboard library in python is not direct input based. This library helped a lot and then instructing mame.ini to use direct input finally made mame recognize python command. All of this would have been much simpler with arduino Leonardo but I didnt want to give up until I played with coding and thought of solutions with my arduino uno. Thanks.
@carlosquinones75602 жыл бұрын
Hey, so I tried to use both pyautogui and pydirectinput but neither of them are working for Halo 5 Forge on PC. It detects the mouse movement and the pydirectinput.press() method works for keyboard inputs but the leftClick() method doesn't work in the game, it only moves the mouse around but the clicks are not registering in neither module. What should I do?
@sameer1234ification2 жыл бұрын
I've been using "mouse" python library for a while to move cursor programmatically; and I recently stumbled upon the issue that it does not get recognized by video games such as call of duty ... I noticed in the morning that "mouse" library uses the same mouse events utilized by PyAutoGUI; So I modified my code to use your library instead and i am currently in the testing process .. I hope it works
@ch66linux39 Жыл бұрын
Hello, I called your library according to the method in your video and tried it. The click operation can proceed normally, but the move operation still has no effect. Do you know how to solve it? My test game is BLOCKPOST. Looking forward to your reply.
@MushroomHunt02 жыл бұрын
Is there currently a version for linux? I am currently running into the issues that you are describing/showing.
@alintaredurand2 ай бұрын
Hi, I don't know if you're still answering on this channel or not, But I'm having trouble with mouse movements... I had the autogui problem with keyboard inputs and after I switched to directinput everything was better, But for now the mouse still doesn't move so I dunno what's the problem I've been stuck on this for like 4 hours, need some input =S
@maiconjogos5 ай бұрын
Well, I was trying to auto a task on Nemu Player, a Emulator for cellphone, but none pyAutoGUI, pyDirectInput or pyWin32 worked.
@pharaohx7k3582 жыл бұрын
Is there any library that will send inputs to controllers? Like moving left stick up..
@estebeste40454 жыл бұрын
Hi! First of all thank you for the tutorials, they are really helpful. I have a question tho. Can some game have their own cursor position different from the your actual cursor position? I'm asking because I'm making a bot for a game that recenters the cursor everytime I move it in game, and the thing is if I use pydirectinput.move(x,y) it moves it inside the game but at very random positions, not where I intend it to move. Also another interesting thing is after i run the function once, it moves to a random position, but then if I move around in game with the cursor(to change its position) and run the function again, the cursor doesn't move at all, like it thinks it's already there. Only if I give it different coordinates it will move again to a random position. If you got any idea what's going on, please let me know! Thanks!
@crazycalias63804 жыл бұрын
este beste are you trying to use it in a first person shooter? I am trying in a first person shooter and I am having the same problem. The cursor doesnt move to where it is supposed to... if you find any solution let me know pls
@LearnCodeByGaming4 жыл бұрын
Hello! So move(x, y) does relative movement from your current mouse position. You might be looking for moveTo(x, y) to go to an absolute position on your screen. There's also moveRel(x, y) which is just another name for move(x, y). Hope that helps! Sorry it's not the best naming conventions, I'm following the function names set by PyAutoGUI.
@LearnCodeByGaming4 жыл бұрын
@@crazycalias6380 Hi! Try using moveTo() instead of move().
@estebeste40454 жыл бұрын
@@LearnCodeByGaming i was using moveTo, sry I said move by mistake
@suleyk40634 жыл бұрын
@@LearnCodeByGaming All of the functions dont seem to work properly in an fps environment. I think its because the game calculates the distance between the before-and-after coordinates then moves the camera, and when combined with the fact that you cant see the absolute cursor position, makes it look like weird, random movement. Any thoughts on a work-around?
@hourz4 жыл бұрын
are we able to cntrl + v with pydirectinput?
@LearnCodeByGaming4 жыл бұрын
Yes, but you can't use the press() shortcut. You need to keyDown('ctrl'), keyDown('v'), keyUp('v'), keyUp('ctrl').
@mark72304 жыл бұрын
Hi, I tried your library but it's not working inside the window of my game. What else I can try?
@henrycharriere52562 жыл бұрын
tnks man, do you have some option for linux? pyautogui does not work moveTo method for me
@imrebudai49304 жыл бұрын
Hello. I try to make a "clicking bot" for MTA:SA,but it seems like none of the libraries work in this game. Everything goes pefectly,until I run it in game. I use exactly the same pydirectinput command as you,but it doesn't work. Do you have any idea,what could cause the problem?
@mariusz83854 жыл бұрын
i've tried both pyautogui and pydirectinput to make my click my mouse in football manager 2009 and it doesnt want to work for some reason... i do see mouse being move but the click doesnt want to work
@surayuthpintawong83323 жыл бұрын
I try to import your library on Ubuntu and I get the error: module 'ctypes' has no attribute 'windll'. Is there a way to fix this?
@LearnCodeByGaming3 жыл бұрын
No sorry this library is only designed for Windows.
@surayuthpintawong83323 жыл бұрын
@@LearnCodeByGaming Ok, Thanks.
@asdasdasasdasdas90733 жыл бұрын
hey any solution for games like black desert online ? directinput doesnt seem to work
@MashenkaRust2 жыл бұрын
what with ebalom
@ThePirateHistory3 жыл бұрын
Have game like counter strike nexon studio, there not work your lib) and i try win32 is the same, can i trigger real output from mouse&
@SmalltimR2 жыл бұрын
Hi, would it be possible to move the mouse along a specific path and speed?
@cristiankaz22642 жыл бұрын
Very well explained and done :) I tried to use this for a game called metin2 but it still didn't work tho :( any ideas why? I tried rocket league and it works just fine. Thank you for the content
@haoranjiang68664 жыл бұрын
hi I am creating an automation tool to move the mouse which can adjust the camera position in a game created by `UE engine`. Trying to use `pydirectinput` and `pywinauto` to control the mouse, but if moving the mouse to a coordinate which has a negative number like: ``` pydirectinput.moveTo(-100,540) or pywinauto.mouse.move(coords=(-100,540)) ``` the camera position in the game will not be changed. wt should I do
@raychen82213 жыл бұрын
it seems the failsafe for pyautogui isn't working when I use DirectInput. Could you fix that?
@TheChipmonks3 жыл бұрын
Thanks for the video man, i just need a little help While using the move method I get a laggy motion, its not smooth as of mouse. Pls help me out
@LearnCodeByGaming3 жыл бұрын
Thanks! Duration and tween haven't been implemented in the mouse moveTo() in PyDirectInput, so jumping to the given coordinates is the expected behavior right now. You'll need to write your own smoothing or pathing for the mouse movement.
@TheChipmonks3 жыл бұрын
@@LearnCodeByGaming sorry but I am not that advance 😂, will wait for future updates of your library. Thanks again for DirectInput
@Bob-em6kn3 жыл бұрын
The mouse moveTo is not working on roblox. It won't move to the position i set until I physically move my mouse, is there any fix to this?
@phongo93433 жыл бұрын
I used pyautogui and directinput but the game window still won't work with mouse click and press, I'm playing Mir4 Global, they use DirectX and OpenGL When I select DirectX the title window of the game can't be found so I don't use DirectX. Then I switched to using OpenGL and found the game window, but mouse clicks and keyboard presses didn't work. Do you have any idea about this problem please help me...thank you
@gnooox2 жыл бұрын
wow this is what i looking for upto now. it works perfectly thanks so much. subscribed before text. thanks a lot
@nickplj123 жыл бұрын
How do I get it to press multiple keys at once?
@steve78783 жыл бұрын
brother this is good work, thank you for sooo much!
@__hazelnut3 жыл бұрын
You are an absolute legend tysm!
@Mikey-zf1lf3 жыл бұрын
so this is really late, but how do I use duration in the moverel function?
@AhmedKamel-ol6qv4 жыл бұрын
Thanks for the great work. Can I input more than key simultaneously?
@LearnCodeByGaming4 жыл бұрын
Yes you can. The only issue I know of is if you press arrow keys at the same time as an alphanumeric key, it acts like shift is being held down. I plan to correct that at some point, but it's still a bug right now.
@AhmedKamel-ol6qv4 жыл бұрын
@@LearnCodeByGaming I am confused of how to did this. can you show me?, thanks a lot. when I write it like this, they got pressed in series. pydirectinput.keyDown('k') pydirectinput.keyDown('u') time.sleep(2.00) pydirectinput.keyUp('k') pydirectinput.keyUp('u')
@LearnCodeByGaming4 жыл бұрын
@@AhmedKamel-ol6qv I think I misunderstood your original question. PyDirectInput isn't able to send multiple keyDown (or keyUp) inputs at exactly the same time. You can do it if you drop down to using ctypes.windll.user32.SendInput directly.
@AhmedKamel-ol6qv4 жыл бұрын
@@LearnCodeByGaming Thanks a lot for your help. I am trying to build my first game Bot using Reinforcement Learning to play Pro Evolution Soccer. I have almost fair background in python, but i am quit familiar with RL as part of my research in Transportation. your videos helped me in my first steps. wish you all the best.
@LearnCodeByGaming4 жыл бұрын
@@AhmedKamel-ol6qv Awesome that sounds sweet, wishing you the best too!
@automaticmonkTV Жыл бұрын
Thanks for making pydirectinput you rock
@ninjatekno19804 жыл бұрын
Hello Ben ! can you help me about my scipt ? I did everything right but my mouse clicks or keyboard events still not works on my windowed screen game. What should i search for on internet i don't know. Here is my code: from pyautogui import * import pyautogui import time import win32api , win32con , win32gui import pydirectinput while keyboard.is_pressed("q") == False: if pyautogui.pixel(994,204)[0] != 88: pydirectinput.keyUp("space") time.sleep(0.5) pydirectinput.keyDown("space")
@LearnCodeByGaming4 жыл бұрын
Hi! I think you mean to call keyDown first, wait half a second, then call keyUp?
@ninjatekno19804 жыл бұрын
@@LearnCodeByGaming Hi again i fixed my exception i just run as administrator to visual studio code and then your pydirectinput that worked. I really thank you for sharing pydirectinput it is really usefull thank you very much 👍🤩
@cozinhadocidao4 жыл бұрын
Hey, my script runs perfect on shell but not on screen. looks like the game dont capture the "w" key or something like that.
@cozinhadocidao4 жыл бұрын
He dont pass the command to the game, u know what i mean? even with the pydirectinput
@Majitsu2 жыл бұрын
tried this but still doesnt control mouse movements or clicks in the game window
@eb9414 жыл бұрын
Super Helpful! You the man
@Ehxx4 жыл бұрын
pyautiogui.keyup gives an attribute error while pyautogui.keydown works fine?
@LearnCodeByGaming4 жыл бұрын
Interesting, any more details? What's the exact error message and what does the code look like? (Please use pastebin.com to show the code)
@Ehxx4 жыл бұрын
@@LearnCodeByGaming Was just a typo importing pyautogui, surprised keydown worked still with the typo.
@xmp95642 жыл бұрын
dude edirectinput not working is there any other python module we can use
@hostgrady4 жыл бұрын
I'm going to criticize the pip in this comment just to be distinct from the other thread. I have noticed the "write" function is quite slow in comparison to autogui's version. On top of that the interval function doesnt really function at all. Idk if this is known but it would be cool to communicate via a bot using this version of pyautogui
@LearnCodeByGaming4 жыл бұрын
Thanks for letting me know, I'll look into it, and thanks for trying out PyDirectInput!
@hostgrady4 жыл бұрын
@@LearnCodeByGaming np, love the support for other games already
@hostgrady4 жыл бұрын
@@LearnCodeByGaming just as an addon, from what I can see, the write function works fine without direct input, I have been able to switch seamlessly between your library and pyautogui's type function seamlessly
@TheFlipsy2 ай бұрын
I know I'm years late, but I'm VERY thankful for PyDirectInput! Is there any way for PyDirectInput to take controllers into account? Only one other library appears to attempt to have controller input be taken into account (vgamepad) but that's also only virtual inputs and so there is no DirectX input for gamepads.
@louiswheelz19934 жыл бұрын
HELP please :( I did the pip install pydirectinput but whenever i try to import it on vscode it says "unable to import pydirectinput"
@LearnCodeByGaming4 жыл бұрын
If you're using a virtual environment, make sure you have the right one activated. If you're not, then make sure the Python you're using to run the script is the same Python path that pip is installing into. Getting these Python environment things sorted is definitely my least favorite part of Python 😕
@louiswheelz19934 жыл бұрын
@@LearnCodeByGaming hey :) some updates, when i try to install pydirectinput and run the same program on my laptop, it works just fine! can you tell me about this environement thing ? maybe that is the issue
@LearnCodeByGaming4 жыл бұрын
@@louiswheelz1993 The exact way to solve your problem is going to vary a lot based on which shell you're using, how you're launching the program, and how Python is installed on your machine. But essentially your goal is to make sure that the Python executable that's running your program is the same one that pip is installing packages into. If you're using GitBash or any other *NIX command line, the commands "which python" and "pip list -v" will show you the relevant paths. You can also manually look in your Python folder for lib/site-packages/ and check there to see if your pip installed packages are there or not. You'll likely need to do some Google searching for "pip package not found" and other terms relevant to your setup to find a fix that works for you.
@louiswheelz19934 жыл бұрын
@@LearnCodeByGaming okay:) i will look into all of that thank you very much! i'm a first year CS student so im more or less 'new' to some of this ! I want to thank you very much for the effort you put into your replies, I really appreciate it a lot! you sir are great and your channel is a hidden gem! you deserve a lot more subs!
@mrweb90873 жыл бұрын
@@LearnCodeByGaming In Windows 8.1 pyautogui.keyDown('alt') pyautogui.keypress('tab') Time.sleep(1) pyautogui.keyUp('alt') This is not working for switching the windows Please help me to solve this problem I also try hotkey Please tell me the solution if anyone knows 🙏🙏
@zarakikenpachi12384 жыл бұрын
can you help me ? when i try to run script on videogame, game crash
@ejoojoo3 жыл бұрын
does this work for unfocused window
@thzeroucken3 жыл бұрын
holy thanks! you the only one who helped me
@normandas96472 жыл бұрын
omg thank you so much man after hours of searching for solutions i found this❤
@cryptofrogich3 жыл бұрын
ERROR: Could not find a version that satisfies the requirement win32gui (from versions: 221.3, 221.4, 221.5) ERROR: No matching distribution found for win32gui >but downloaded to the root file, that is, it does not start it, what's the problem?
@VaneHD3 жыл бұрын
Hi, hope you are doing well, on the popular game called Roblox it does not seem to work pyautogui.moveTo(pyautogui.locateOnScreen("image.png",confidence=0.9)) -- moves mouse to image pydirectinput.click() -- clicks on where mouse (positioned in the in-game button) is but just doesn't work
@ЯнМатвеев-г9я Жыл бұрын
tysm! i tried ALOT of libs and none of them worked, but this one did :) i was trying to do wave auto skip for TDS in Roblox
@AdriRPerez2 жыл бұрын
i am having an issue where i can only right click once and left click once, after the first time, if i try to right or left click again it does not register, can anyone help?
@nguyenangkhanh14853 жыл бұрын
Thank you so much, this pretty much worked for me but some cases don't. For the Teamfight Tactic game, the keyboard event works like a charm but when I try to /ff (surrender), a new window appears and let me choose to accept quit or not and after that mouse function is fire to click accept button, it's done click, but seem like the game isn't taking that input from mouse, how can I fix it? The CMD and game run as Administrator.
@BCB010-d9o4 жыл бұрын
Is time.sleep() is necessary to use keyDown() ? Bcuz when I use keyDown() it only pressed one time How Can I hold down the key :(
@dag_68814 жыл бұрын
Use looping
@mrweb90873 жыл бұрын
In Windows 8.1 pyautogui.keyDown('alt') pyautogui.keypress('tab') Time.sleep(1) pyautogui.keyUp('alt') This is not working for switching the windows Please help me to solve this problem I also try hotkey Please tell me the solution if anyone knows 🙏🙏