ctypes.windll.user32.mouse_event turns off screen

不问归期 提交于 2021-01-28 00:50:31

问题


If I put that line ctypes.windll.user32.mouse_event(4, 0, 0, 0, 0) in a python script and run the script (double clic on file, start from console, import it in python console and run it), my screen turns off. However, if I run the line directly from the python console, nothing visible happens. This behaviour only started quite recently (before the screen did not turned off).

(If you think it may be caused by the OS/system, don't hesitate to ask for details in the comments.)

Minimal working example:

import ctypes
ctypes.windll.user32.mouse_event(4, 0, 0, 0, 0)

来源:https://stackoverflow.com/questions/57625356/ctypes-windll-user32-mouse-event-turns-off-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!