當前位置: 首頁>>代碼示例>>Python>>正文


Python win32con.MOUSEEVENTF_LEFTUP屬性代碼示例

本文整理匯總了Python中win32con.MOUSEEVENTF_LEFTUP屬性的典型用法代碼示例。如果您正苦於以下問題:Python win32con.MOUSEEVENTF_LEFTUP屬性的具體用法?Python win32con.MOUSEEVENTF_LEFTUP怎麽用?Python win32con.MOUSEEVENTF_LEFTUP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在win32con的用法示例。


在下文中一共展示了win32con.MOUSEEVENTF_LEFTUP屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: mouse_drag

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def mouse_drag(self, pos1, pos2):
        """
        鼠標拖拽
            :param pos1: (x,y) 起點坐標
            :param pos2: (x,y) 終點坐標
        """
        pos1_s = win32gui.ClientToScreen(self.hwnd, pos1)
        pos2_s = win32gui.ClientToScreen(self.hwnd, pos2)
        screen_x = win32api.GetSystemMetrics(win32con.SM_CXSCREEN)
        screen_y = win32api.GetSystemMetrics(win32con.SM_CYSCREEN)
        start_x = pos1_s[0]*65535//screen_x
        start_y = pos1_s[1]*65535//screen_y
        dst_x = pos2_s[0]*65535//screen_x
        dst_y = pos2_s[1]*65535//screen_y
        move_x = np.linspace(start_x, dst_x, num=20, endpoint=True)[0:]
        move_y = np.linspace(start_y, dst_y, num=20, endpoint=True)[0:]
        self.mouse_move(pos1)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
        for i in range(20):
            x = int(round(move_x[i]))
            y = int(round(move_y[i]))
            win32api.mouse_event(win32con.MOUSEEVENTF_MOVE |
                                 win32con.MOUSEEVENTF_ABSOLUTE, x, y, 0, 0)
            time.sleep(0.01)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) 
開發者ID:AcademicDog,項目名稱:onmyoji_bot,代碼行數:27,代碼來源:game_ctl.py

示例2: tap

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def tap(self, x, y):
        if self.run_time.stop:
            return
        x, y = int(x), int(y)
        self.root.debug("Tapping at location ({},{})".format(x, y))
        if self._debug:
            # Helper to debug taps
            input("waiting for confirmation press enter")
        ox, oy = win32api.GetCursorPos()
        curr_window = win32gui.GetForegroundWindow()
        win32gui.ShowWindow(self.win_handle, win32con.SW_RESTORE)
        x, y = int(x), int(y)
        cx, cy = win32gui.ClientToScreen(self.win_handle, (x, y))
        x, y = self.__calculate_absolute_coordinates__(cx, cy)
        win32api.mouse_event(win32con.MOUSEEVENTF_MOVE | win32con.MOUSEEVENTF_ABSOLUTE,
                             x, y, 0, 0)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
        time.sleep(20 / 1000)
        win32api.SetCursorPos((ox, oy))
        win32gui.SetActiveWindow(curr_window) 
開發者ID:will7200,項目名稱:Yugioh-bot,代碼行數:23,代碼來源:steam.py

示例3: lmb_up

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def lmb_up():
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0) 
開發者ID:CharlesDankoff,項目名稱:ultra_secret_scripts,代碼行數:4,代碼來源:very_secret_script.py

示例4: mouse_click

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def mouse_click(x=None, y=None):
    """
    模擬鼠標點擊
    :param x: int, 鼠標點擊位置橫坐標
    :param y: int, 鼠標點擊位置縱坐標
    :return: None
    """
    if not x is None and not y is None:
        mouse_move(x, y)
        time.sleep(0.05)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) 
開發者ID:moranzcw,項目名稱:PlayJumpGame,代碼行數:14,代碼來源:play_jump_game.py

示例5: mouse_pclick

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def mouse_pclick(x=None, y=None, press_time=0.0):
    """
    模擬式長按鼠標
    :param x: int, 鼠標點擊位置橫坐標
    :param y: int, 鼠標點擊位置縱坐標
    :param press_time: float, 點擊時間,單位秒
    :return: None
    """
    if not x is None and not y is None:
        mouse_move(x, y)
        time.sleep(0.05)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
    time.sleep(press_time)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) 
開發者ID:moranzcw,項目名稱:PlayJumpGame,代碼行數:16,代碼來源:play_jump_game.py

示例6: left_click

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def left_click(self, left_offset, top_offset):
        pos = self.window.get_box(left_offset, top_offset)
        SetCursorPos(pos)
        mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
        mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)

    # 單擊鼠標右鍵
    # left_offset和top_offset表示
    # 從左往右第left_offset個,從上往下第top_offset個格子
    # 索引從0開始 
開發者ID:buaazyc,項目名稱:Automatic-minesweeping,代碼行數:12,代碼來源:use_keyboard_and_mouse.py

示例7: left_and_right_click

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def left_and_right_click(self, left_offset, top_offset):
        pos = self.window.get_box(left_offset, top_offset)
        SetCursorPos(pos)
        mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
        mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
        mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
        mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)

    # 按下鍵盤F2 
開發者ID:buaazyc,項目名稱:Automatic-minesweeping,代碼行數:11,代碼來源:use_keyboard_and_mouse.py

示例8: clickPoint

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def clickPoint(self, id):
		if id:
			pnt = ClientToScreen(id,(5,5))
#			print 'ClickPoint', pnt
			currentCursorPos = GetCursorPos()
			SetCursorPos(pnt)
			mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,pnt[0],pnt[1],0,0)
			mouse_event(win32con.MOUSEEVENTF_LEFTUP,pnt[0],pnt[1],0,0)
			SetCursorPos(currentCursorPos)
			mxs.setWaitCursor()
#		else:
#			print "Could not find window to click on" 
開發者ID:blurstudio,項目名稱:cross3d,代碼行數:14,代碼來源:rescaletime.py

示例9: touch

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def touch(self, x, y, duration=0.1):
        ''' Simulate touch '''
        (ox, oy) = self.mouseposition() # remember mouse position
        x, y = self._resetpt(x, y)
        win32api.SetCursorPos((x,y))

        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)
        time.sleep(duration)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0)
        win32api.SetCursorPos((ox,oy)) # move back mouse position 
開發者ID:NetEase,項目名稱:airtest,代碼行數:12,代碼來源:windows.py

示例10: clickMenuButton

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def clickMenuButton(hwnd, offset):
    left, top, right, bottom = win32gui.GetWindowRect(hwnd)
    win32api.SetCursorPos([left + offset, (bottom - top) // 2 + top])
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
    time.sleep(0.1)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
    time.sleep(0.3) 
開發者ID:ynzheng,項目名稱:pyautotrade_tdx,代碼行數:9,代碼來源:winguiauto.py

示例11: autoRelease

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def autoRelease(result,game_x,game_y):
    for i in range(0,len(result)):
        for j in range(0,len(result[0])):
            # 以上兩個for循環,定位第一個選中點
            if result[i][j] != 0:
                for m in range(0,len(result)):
                    for n in range(0,len(result[0])):
                        if result[m][n] != 0:
                            # 後兩個for循環定位第二個選中點
                            if matching.canConnect(i,j,m,n,result):
                            # 執行消除算法並返回
                                result[i][j] = 0
                                result[m][n] = 0
                                print('可消除點:'+ str(i+1) + ',' + str(j+1) + '和' + str(m+1) + ',' + str(n+1))
                                x1 = game_x + j*SQUARE_WIDTH
                                y1 = game_y + i*SQUARE_HEIGHT
                                x2 = game_x + n*SQUARE_WIDTH
                                y2 = game_y + m*SQUARE_HEIGHT
                                win32api.SetCursorPos((x1 + 15,y1 + 18))
                                win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x1+15, y1+18, 0, 0)
                                win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x1+15, y1+18, 0, 0)
                                time.sleep(TIME_INTERVAL)

                                win32api.SetCursorPos((x2 + 15, y2 + 18))
                                win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x2 + 15, y2 + 18, 0, 0)
                                win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x2 + 15, y2 + 18, 0, 0)
                                time.sleep(TIME_INTERVAL)
                                return True
    return False 
開發者ID:TheThreeDog,項目名稱:Auto-Lianliankan,代碼行數:31,代碼來源:run.py

示例12: _input_left_mouse

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def _input_left_mouse(self, x, y):
        left, top, right, bottom = self.rect
        width, height = right - left, bottom - top
        if x < 0 or x > width or y < 0 or y > height:
            return

        win32gui.SetForegroundWindow(self.hwnd)
        pos = win32gui.GetCursorPos()
        win32api.SetCursorPos((left+x, top+y))
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)
        win32api.Sleep(100) #ms
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0)
        win32api.Sleep(100) #ms
        # win32api.SetCursorPos(pos) 
開發者ID:NetEaseGame,項目名稱:ATX,代碼行數:16,代碼來源:windows.py

示例13: mouse_click

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def mouse_click(self):
        """
        鼠標單擊
        """
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
        time.sleep(random.randint(20, 80)/1000)
        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) 
開發者ID:AcademicDog,項目名稱:onmyoji_bot,代碼行數:9,代碼來源:game_ctl.py

示例14: clickWindow

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def clickWindow(hwnd, offset):
    left, top, right, bottom = win32gui.GetWindowRect(hwnd)
    # print('left, top, right, bottom', left, top, right, bottom)
    win32api.SetCursorPos([left + offset, (bottom - top) // 2 + top])
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
    time.sleep(0.2)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
    time.sleep(0.2) 
開發者ID:drongh,項目名稱:pyAutoTrading,代碼行數:10,代碼來源:winguiauto.py

示例15: click

# 需要導入模塊: import win32con [as 別名]
# 或者: from win32con import MOUSEEVENTF_LEFTUP [as 別名]
def click(x,y):
    win32api.SetCursorPos((x,y))
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0) 
開發者ID:scholi,項目名稱:pySPM,代碼行數:6,代碼來源:win32_helper.py


注:本文中的win32con.MOUSEEVENTF_LEFTUP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。