joystick: add missing type conversion

Signed-off-by: morfeo8marc <morfeo8marc@gmail.com>
This commit is contained in:
morfeo8marc 2018-05-07 22:47:18 +02:00
parent 846e992bf2
commit 0fd6cf480a
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ func run() int {
t.Timestamp, t.Hat, t.Value) t.Timestamp, t.Hat, t.Value)
case *sdl.JoyDeviceEvent: case *sdl.JoyDeviceEvent:
if t.Type == sdl.JOYDEVICEADDED { if t.Type == sdl.JOYDEVICEADDED {
joysticks[int(t.Which)] = sdl.JoystickOpen(t.Which) joysticks[int(t.Which)] = sdl.JoystickOpen(int(t.Which))
if joysticks[int(t.Which)] != nil { if joysticks[int(t.Which)] != nil {
fmt.Printf("Joystick %d connected\n", t.Which) fmt.Printf("Joystick %d connected\n", t.Which)
} }