The JoyButtonEvent handler was checking against t.Type when it should have been checking against t.State. this caused the script to always state a button was released, even if the event was indicating the button was pressed.
There appears to be a missing int cast on the JoyDeviceAddedEvent, which resulted in compile errors.
./example.go:73:49: cannot use t.Which (type sdl.JoystickID) as type int in argument to sdl.JoystickOpen
Fixed some small issues in the joystick example.
The
JoyButtonEvent
handler was checking againstt.Type
when it should have been checking againstt.State
. this caused the script to always state a button was released, even if the event was indicating the button was pressed.There appears to be a missing int cast on the
JoyDeviceAddedEvent
, which resulted in compile errors.