以下程序实现了在编辑框处点击,然后用键盘输入的功能

import pyautogui
import time

time.sleep(10)

currentMouseX, currentMouseY = pyautogui.position()
print(currentMouseX,currentMouseY)  #打印鼠标位置

pyautogui.click(x=261, y=118, clicks=1,  button='left')  #绝对位置点击
pyautogui.typewrite("hello world") #键盘输入

注:键盘输入是模拟键盘输入,输入法需要在英文状态下

      目前无法实现中文的直接数据只能输入法在中文,输入后拼出啥是啥

import pyautogui
import time

time.sleep(10)

currentMouseX, currentMouseY = pyautogui.position()
print(currentMouseX,currentMouseY)  #打印鼠标位置

pyautogui.click(x=261, y=118, clicks=1,  button='left')  #绝对位置点击
pyautogui.typewrite("nihao") #键盘输入
pyautogui.press("space") #键盘输入空格

相关文章:

  • 2022-02-06
  • 2021-06-06
  • 2021-12-03
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-12-19
  • 2021-10-01
相关资源
相似解决方案