Pygame错误地检测到不存在的操纵杆

问题描述 投票:0回答:1

我对pygame有一个奇怪的问题我没有将游戏杆连接到笔记本电脑,但pygame.joystick.get_count()返回1它甚至可以检测轴输入。连接到我的计算机的设备是:鼠标,键盘和wacom键盘。

未连接其他USB设备。编辑:我做了以下测试脚本

import pygame

pygame.init()
pygame.joystick.init()
print("joystick count:",pygame.joystick.get_count())
gJoystick = pygame.joystick.Joystick(0)
gJoystick.init()
print(gJoystick.get_init())
fGetEvent = True
while fGetEvent:
    for event in pygame.event.get():
        if event.type == pygame.JOYBUTTONDOWN:
            print("joystick button pressed")
            fGetEvent = False

gJoystick.init()
print(gJoystick.get_numaxes())

当我按下intuos数位板上的按钮时,它将注册为操纵杆按钮的按下。我必须断开平板电脑连接才能正常运行吗?

python pygame tablet
1个回答
0
投票

是的,包括python在内的大量程序将wacom数位板输入检测为操纵杆输入。您只需要拔下它。

© www.soinside.com 2019 - 2024. All rights reserved.