diff --git a/internal/gamepaddb/gamepaddb.go b/internal/gamepaddb/gamepaddb.go index cd1c9c099..f6db4b9d8 100644 --- a/internal/gamepaddb/gamepaddb.go +++ b/internal/gamepaddb/gamepaddb.go @@ -499,12 +499,6 @@ func Update(mapping []byte) (bool, error) { 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() defer mappingsM.Unlock() diff --git a/internal/uidriver/mobile/gamepad_ios.go b/internal/uidriver/mobile/gamepad_ios.go index 027bae2f7..f47a96358 100644 --- a/internal/uidriver/mobile/gamepad_ios.go +++ b/internal/uidriver/mobile/gamepad_ios.go @@ -452,6 +452,7 @@ func (i *Input) updateGamepads() { Name: string(name), ButtonNum: int(property.nButtons), AxisNum: int(property.nAxes), + HatNum: int(property.nHats), } var state C.struct_ControllerState @@ -476,6 +477,10 @@ func (i *Input) updateGamepads() { gamepad.Axes[j] = float32(state.axes[j]) } + if gamepad.HatNum > 0 { + gamepad.Hats[0] = int(state.hat) + } + i.gamepads = append(i.gamepads, gamepad) } }