mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
examples/gamepad: Refactoring
This commit is contained in:
parent
c9a244f498
commit
b1c55f395f
@ -33,10 +33,6 @@ const (
|
||||
)
|
||||
|
||||
func update(screen *ebiten.Image) error {
|
||||
ids := ebiten.GamepadIDs()
|
||||
axes := map[int][]string{}
|
||||
pressedButtons := map[int][]string{}
|
||||
|
||||
for _, id := range inpututil.JustConnectedGamepadIDs() {
|
||||
log.Printf("gamepad connected: id: %d", id)
|
||||
}
|
||||
@ -44,6 +40,10 @@ func update(screen *ebiten.Image) error {
|
||||
log.Printf("gamepad disconnected: id: %d", id)
|
||||
}
|
||||
|
||||
ids := ebiten.GamepadIDs()
|
||||
axes := map[int][]string{}
|
||||
pressedButtons := map[int][]string{}
|
||||
|
||||
for _, id := range ids {
|
||||
maxAxis := ebiten.GamepadAxisNum(id)
|
||||
for a := 0; a < maxAxis; a++ {
|
||||
|
Loading…
Reference in New Issue
Block a user