From 52dea245dcbf19564a6bdb037ace43b55faf0f99 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 30 Apr 2018 03:43:50 +0900 Subject: [PATCH] examples/blocks: Use IsGamepadButtonJustPressed --- examples/blocks/blocks/gamepad.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/blocks/blocks/gamepad.go b/examples/blocks/blocks/gamepad.go index 2f0ea67c2..5cd04e100 100644 --- a/examples/blocks/blocks/gamepad.go +++ b/examples/blocks/blocks/gamepad.go @@ -18,6 +18,7 @@ import ( "fmt" "github.com/hajimehoshi/ebiten" + "github.com/hajimehoshi/ebiten/inpututil" ) type virtualGamepadButton int @@ -104,7 +105,7 @@ func (c *gamepadConfig) Scan(gamepadID int, b virtualGamepadButton) bool { if _, ok := c.assignedButtons[eb]; ok { continue } - if ebiten.IsGamepadButtonPressed(gamepadID, eb) { + if inpututil.IsGamepadButtonJustPressed(gamepadID, eb) { c.buttons[b] = eb c.assignedButtons[eb] = struct{}{} return true