internal/gamepad: refactoring

This commit is contained in:
Hajime Hoshi 2022-06-03 19:00:21 +09:00
parent 2eb4ef1a94
commit 8e4e3d67c4

View File

@ -142,7 +142,6 @@ var (
procGetModuleHandleW = kernel32.NewProc("GetModuleHandleW")
procCallWindowProcW = user32.NewProc("CallWindowProcW")
procGetActiveWindow = user32.NewProc("GetActiveWindow")
procGetRawInputDeviceInfoW = user32.NewProc("GetRawInputDeviceInfoW")
procGetRawInputDeviceList = user32.NewProc("GetRawInputDeviceList")
@ -166,11 +165,6 @@ func _CallWindowProcW(lpPrevWndFunc uintptr, hWnd uintptr, msg uint32, wParam, l
return r
}
func _GetActiveWindow() windows.HWND {
h, _, _ := procGetActiveWindow.Call()
return windows.HWND(h)
}
func _GetRawInputDeviceInfoW(hDevice windows.Handle, uiCommand uint32, pData unsafe.Pointer, pcb *uint32) (uint32, error) {
r, _, e := procGetRawInputDeviceInfoW.Call(uintptr(hDevice), uintptr(uiCommand), uintptr(pData), uintptr(unsafe.Pointer(pcb)))
if uint32(r) == ^uint32(0) {