Im searching other ways to block mouse and keyboard. Some suggest to use BlockInput(). Can this be done by python? I’m using windows XP
Im searching other ways to block mouse and keyboard. Some suggest to use BlockInput()
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Such WinAPI functions can be called using
ctypesmodule.You need to know in which DLL the function is. In this case it’s user32.dll (that info is listed on the msdn documentation page you linked).
Then you need to know its params. This one takes one
BOOLargument so we can use Python’sbooldirectly.See the explanation of the return value in the docs. The output will be a Python
intwhich is ok in this simple case but you should know thatctypeslets you specifiy the exact argument and return value types if needed.I’ve just tried that on Windows 7 box and it works but only if the process is running with elevated privileges (otherwise it just returns 0). Since you’re running XP, this might be irrelevant to you.