خرید بک لینک

Vote count: 0

I wrote this code to lock a mouse in the middle of the screen

def lockmouse():
print "here"
while True:
    win32api.SetCursorPos((GetSystemMetrics(0)/2,GetSystemMetrics(1)/2))
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,GetSystemMetrics(0)/2,GetSystemMetrics(1)/2,0,0)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,GetSystemMetrics(0)/2,GetSystemMetrics(1)/2,0,0)


t = threading.Thread(target=lockmouse())
command = "lockmouse"
    if "lockmouse" in command:
        if t.is_alive==False:
            t.start()
            time.sleep(3)
            t._Thread_stop()

and its not keep going after the t.start().I've been trying using different methods to stop the thread,but its even not make it after that line.anyone know what the problem?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 3 خرداد 1395 ساعت: 14:39

صفحه بندی