问题
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