mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 17:32:02 +01:00
internal/gamepad: refactoring
This commit is contained in:
parent
2eb4ef1a94
commit
8e4e3d67c4
@ -142,7 +142,6 @@ var (
|
|||||||
procGetModuleHandleW = kernel32.NewProc("GetModuleHandleW")
|
procGetModuleHandleW = kernel32.NewProc("GetModuleHandleW")
|
||||||
|
|
||||||
procCallWindowProcW = user32.NewProc("CallWindowProcW")
|
procCallWindowProcW = user32.NewProc("CallWindowProcW")
|
||||||
procGetActiveWindow = user32.NewProc("GetActiveWindow")
|
|
||||||
procGetRawInputDeviceInfoW = user32.NewProc("GetRawInputDeviceInfoW")
|
procGetRawInputDeviceInfoW = user32.NewProc("GetRawInputDeviceInfoW")
|
||||||
procGetRawInputDeviceList = user32.NewProc("GetRawInputDeviceList")
|
procGetRawInputDeviceList = user32.NewProc("GetRawInputDeviceList")
|
||||||
|
|
||||||
@ -166,11 +165,6 @@ func _CallWindowProcW(lpPrevWndFunc uintptr, hWnd uintptr, msg uint32, wParam, l
|
|||||||
return r
|
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) {
|
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)))
|
r, _, e := procGetRawInputDeviceInfoW.Call(uintptr(hDevice), uintptr(uiCommand), uintptr(pData), uintptr(unsafe.Pointer(pcb)))
|
||||||
if uint32(r) == ^uint32(0) {
|
if uint32(r) == ^uint32(0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user