Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/330.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
DirectX游戏中的Python3移动鼠标_Python_Windows_Python 3.x_Directx - Fatal编程技术网

DirectX游戏中的Python3移动鼠标

DirectX游戏中的Python3移动鼠标,python,windows,python-3.x,directx,Python,Windows,Python 3.x,Directx,我正在尝试创建一个脚本,在DirectX游戏中执行一些操作 除了移动鼠标,我的一切都正常工作 对于windows(Python3),是否有任何可以移动鼠标的模块可用 谢谢 使用名为sikulix的免费应用程序。使用名为sikulix的免费软件应用程序,它将为您带来奇迹。它将为您带来奇迹我曾经在Python2.7中使用过。我刚刚检查了Python3.7,它可以移动光标。链接源中的示例代码: from pynput.mouse import Button, Controller mouse = C

我正在尝试创建一个脚本,在DirectX游戏中执行一些操作

除了移动鼠标,我的一切都正常工作

对于windows(Python3),是否有任何可以移动鼠标的模块可用


谢谢

使用名为sikulix的免费应用程序。使用名为sikulix的免费软件应用程序,它将为您带来奇迹。它将为您带来奇迹

我曾经在Python2.7中使用过。我刚刚检查了Python3.7,它可以移动光标。链接源中的示例代码:

from pynput.mouse import Button, Controller

mouse = Controller()

# Read pointer position
print('The current pointer position is {0}'.format(
    mouse.position))

# Set pointer position
mouse.position = (10, 20)
print('Now we have moved it to {0}'.format(
    mouse.position))

# Move pointer relative to current position
mouse.move(5, -5)

# Press and release
mouse.press(Button.left)
mouse.release(Button.left)

# Double click; this is different from pressing and releasing
# twice on Mac OSX
mouse.click(Button.left, 2)

# Scroll two steps down
mouse.scroll(0, 2)
编辑:刚刚在DirectX游戏中成功测试。

我曾在Python 2.7中使用过一次。我刚刚检查了Python3.7,它可以移动光标。链接源中的示例代码:

from pynput.mouse import Button, Controller

mouse = Controller()

# Read pointer position
print('The current pointer position is {0}'.format(
    mouse.position))

# Set pointer position
mouse.position = (10, 20)
print('Now we have moved it to {0}'.format(
    mouse.position))

# Move pointer relative to current position
mouse.move(5, -5)

# Press and release
mouse.press(Button.left)
mouse.release(Button.left)

# Double click; this is different from pressing and releasing
# twice on Mac OSX
mouse.click(Button.left, 2)

# Scroll two steps down
mouse.scroll(0, 2)

编辑:刚刚在DirectX游戏中成功测试。

他正在尝试自己编写代码。我认为在这种情况下,这个答案有点多余:)将进行研究,但除了pyhon,我更愿意不使用其他工具。他正在尝试自己编写代码。我认为这个答案在这种情况下有点多余:)将研究,但我宁愿不使用pyhon以外的其他工具。我想在3D第三人称游戏中使用它,我尝试过这种方法。不幸的是,它没有响应。确切地说,是哪个游戏?还是哪个引擎?也许我能帮上忙/测试一下。我想在3D第三人称游戏中使用它,我尝试过这种方法。不幸的是,它没有反应。到底是哪款游戏?还是哪个引擎?也许我可以帮我/测试一下。