From 0af6497017c58cc800faf128a3380a915cf4c6f8 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 19 Oct 2024 22:43:14 +0900 Subject: [PATCH] internal/ui: update gamepads for PS5 --- internal/ui/input_playstation5.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/internal/ui/input_playstation5.go b/internal/ui/input_playstation5.go index 89cd2975d..42c6d0c09 100644 --- a/internal/ui/input_playstation5.go +++ b/internal/ui/input_playstation5.go @@ -16,8 +16,23 @@ package ui +import ( + "github.com/hajimehoshi/ebiten/v2/internal/gamepad" +) + func (u *UserInterface) updateInputState() error { - // TODO: Implement this + var err error + u.mainThread.Call(func() { + err = u.updateInputStateImpl() + }) + return err +} + +// updateInputStateImpl must be called from the main thread. +func (u *UserInterface) updateInputStateImpl() error { + if err := gamepad.Update(); err != nil { + return err + } return nil }