2017-11-03 15 views
0

현재 저는 USB 게임 컨트롤러 역할을하는 프로그램을 작업하고 있지만 키 누르기와 움직임을 시뮬레이션하는 방법을 찾는 데 어려움을 겪고 있습니다 ...게임 컨트롤러 키 입력을 시뮬레이트하는 방법은 무엇입니까?

저는 python으로 작업하기를 희망하지만 아무 것도 작동하지 않을 것입니다.

+2

우리가 당신을 도울 수 있도록하는 두 가지 힌트 : 포스트를 현재 가지고있는 코드를, 또한 당신이 가지고있는 문제에 대한 구체적 (예를 들어, 오류가있는 경우 오류를 게시 한 경우) –

답변

0

pyvjoy를 살펴보면 에뮬레이터 x360ce이 설치되어있을 때 컨트롤러를 시뮬레이트 할 수 있습니다.

코드가 입력을 시뮬레이션 할 수있게 해주는이 로켓 리그 봇 프레임 워크를 살펴보십시오.

예 :

import pyvjoy 

class PlayHelper: 

    def __init__(self, player_index): 
     self.device = pyvjoy.VJoyDevice(player_index + 1) 

    def update_controller(self, output): 
     self.device.data.wAxisX = output[0] 
     self.device.data.wAxisY = output[1] 
     self.device.data.wAxisZRot = output[2] 
     self.device.data.wAxisZ = output[3] 
     self.device.data.lButtons = (1 * output[4]) + (2 * output[5]) + (4 * output[6]) 

     self.device.data.wAxisXRot = 16383 
     self.device.data.wAxisYRot = 16383 

     self.device.update() # Send data to vJoy device 

출처 : https://github.com/drssoccer55/RLBot

+0

어떻게 설치합니까? –