English 中文(简体)
点击指挥系统未就某些地静止轨道进行工作
原标题:Mouse click command does not work on certain GUIs

以下文字完美地发挥作用,例如,我想点击Windows的起始纽顿,但当我试图在某个全球倡议方案中点击ton子时,它没有任何效果。

Is it possible that this program has disabled virtual mouse clicks? If so, can I circumvent this somehow?

import win32api, win32con
Po=win32api.GetCursorPos()
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,Po[0],Po[1],0,0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,Po[0],Po[1],0,0)
最佳回答

mouse_event (and SendInput, which is the preferred API to use for input) have a couple of tricky bits, it s a good idea to read the MSDN page for mouse_event fully and carefully before using it - pay attention to the small print: in particular, the x and y values are not pixels, so you can t just put in values you get from GetCursorPos.

恰如其分,0-0是底层左上角,因此,底层左边的点将大致位于屏幕的同一地区,但比你更远的地方,比照该信标使用的实际单位更差:因此,它似乎可以在北顿附近(假定位于屏幕底部)工作,但就其他价值而言,它似乎会点击,与你看到的相似。

来自MSDN:

dx [in]
Type: DWORD
The mouse s absolute position along the x-axis or its amount of motion since the last mouse event was generated, depending on the setting of MOUSEEVENTF_ABSOLUTE. Absolute data is specified as the mouse s actual x-coordinate; relative data is specified as the number of mickeys moved. A mickey is the amount that a mouse has to move for it to report that it has moved.

首先,你们需要《谅解备忘录》的旗帜。 但这并非全部:

Remarks
... If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner.

......因此,在将目标坐标转至本份标书之前,你需要适当规模。

问题回答

各种方案产生的改变用途活动有“被掠夺”的财产,如果他们想要的话,可对其进行过滤,例如,MO客户经常过滤这些财产,以避免机器人。

mo树中的这些零点使你能够确定一些特性,如果这些零点能够让你克服所投的旗帜,那么你可能想研究这些零点,尽管我无法立即找到一种办法。

下面的法典对我做了规定。

pyautogui.mouseDown(fromx, fromy)
time.sleep(2)
pyautogui.mouseUp(tox, toy)
pyautogui.mouseUp(1000,400)




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签