'Connect' to a joystick by index number, then use methods to add event channels, one for each button or hat, and start running by calling 'ParcelOutEvents'.
event channels provide at least time. event is an interface with a 'Moment' method which returns a time.Duration.
event, an interface with a 'Moment' method, provides a time.Duration. Moment() returns whatever the underlying Linux driver provides as the events timestamp, in time.Duration.
event 'Moment' returns whatever the underlying Linux driver provides as the events timestamp, in time.Duration.
hat channel event provides current position, (x,y) the event will need casting to the hat event to access these. (with only one axis changing per event.)
hat channel event provides current position, (x,y) the event will need casting to the hat event to access these. (and only one axis actually changes per event.)
or (DIY)
'Connect' to a joystick by index number
handle all events directly using the returned State's OSEvent channel.
handle all events directly using the returned Joystick's OSEvent channel.
*/
packagejoysticks
/*
could be used with little change on any linux 'input'