简体   繁体   中英

Python win32api mouse control losing focus

I'm using win32api in a Python script to control mouse movements. It's working fantastic, but as soon as I click (I also generate click events) outside my Python shell/IDE, all my mouse events immediately stop. If I click my shell/IDE again, control is restored.

It seems like mouse control is only working when my Python shell or IDE is the "active" window - is there any way to retain mouse control even after Python is sent to the background?

Turns out this was not a Python issue, but was an issue with the device I was using to generate mouse movements. A separate API call was required to allow this device to push events when its owner was out of focus.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM