示例#1
0
def _init_directinput():
    global dinput
    dinput = IDirectInput8()
    module = _kernel32.GetModuleHandleW(None)
    DIRECTINPUT_VERSION = 0x0800
    lib.DirectInput8Create(module, DIRECTINPUT_VERSION, IID_IDirectInput8W,
                           ctypes.byref(dinput), None)
示例#2
0
def _init_directinput():
    global _i_dinput
    if _i_dinput:
        return

    _i_dinput = dinput.IDirectInput8()
    module = _kernel32.GetModuleHandleW(None)
    dinput.DirectInput8Create(module, dinput.DIRECTINPUT_VERSION,
                              dinput.IID_IDirectInput8W,
                              ctypes.byref(_i_dinput), None)