mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 18:52:44 +01:00
parent
8334ca9a18
commit
edff1f0dd9
@ -499,12 +499,6 @@ func Update(mapping []byte) (bool, error) {
|
|||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Implement this (#1722)
|
|
||||||
if currentPlatform == platformIOS {
|
|
||||||
// Note: NOT returning an error, as mappings also do not matter right now.
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
mappingsM.Lock()
|
mappingsM.Lock()
|
||||||
defer mappingsM.Unlock()
|
defer mappingsM.Unlock()
|
||||||
|
|
||||||
|
@ -452,6 +452,7 @@ func (i *Input) updateGamepads() {
|
|||||||
Name: string(name),
|
Name: string(name),
|
||||||
ButtonNum: int(property.nButtons),
|
ButtonNum: int(property.nButtons),
|
||||||
AxisNum: int(property.nAxes),
|
AxisNum: int(property.nAxes),
|
||||||
|
HatNum: int(property.nHats),
|
||||||
}
|
}
|
||||||
|
|
||||||
var state C.struct_ControllerState
|
var state C.struct_ControllerState
|
||||||
@ -476,6 +477,10 @@ func (i *Input) updateGamepads() {
|
|||||||
gamepad.Axes[j] = float32(state.axes[j])
|
gamepad.Axes[j] = float32(state.axes[j])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if gamepad.HatNum > 0 {
|
||||||
|
gamepad.Hats[0] = int(state.hat)
|
||||||
|
}
|
||||||
|
|
||||||
i.gamepads = append(i.gamepads, gamepad)
|
i.gamepads = append(i.gamepads, gamepad)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user