xbox 360 컨트롤러가 울리기 (진동)하기 시작하는 스크립트를 발견했지만 그 기능을 끌 수는 없습니다. 5 초 후에 럼블이 멈추도록 설정할 수 있습니까? 당신이 바로이 스크립트와 당신의 앞에 필요한 모든 것을 가지고 같은Xbox 360이 윙윙 거리며 진동합니까?
import ctypes
# Define necessary structures
class XINPUT_VIBRATION(ctypes.Structure):
_fields_ = [("wLeftMotorSpeed", ctypes.c_ushort),
("wRightMotorSpeed", ctypes.c_ushort)]
xinput = ctypes.windll.xinput1_1 # Load Xinput.dll
# Set up function argument types and return type
XInputSetState = xinput.XInputSetState
XInputSetState.argtypes = [ctypes.c_uint, ctypes.POINTER(XINPUT_VIBRATION)]
XInputSetState.restype = ctypes.c_uint
# Now we're ready to call it. Set left motor to 100%, right motor to 50%
# for controller 0
vibration = XINPUT_VIBRATION(65535, 32768)
XInputSetState(0, ctypes.byref(vibration))
# You can also create a helper function like this:
def set_vibration(controller, left_motor, right_motor):
vibration = XINPUT_VIBRATION(int(left_motor * 65535), int(right_motor * 65535))
XInputSetState(controller, ctypes.byref(vibration))
# ... and use it like so
set_vibration(0, 0.5, 0.5,)
감사
'set_vibration (0, 0, 0)'을 시도해 보셨습니까? – Tyler