Package joysticks, provides simplified event routing, by channels, from the Linux joystick driver File-like interface.
Package joysticks, provides simplified event routing, through channels, from the Linux joystick driver File-like interface.
events can be listened for from any thread, re-routed and simulated.
*/
packagejoysticks
usage:
/*
usage details.
'Capture', a single call to setup and start basic event routing.
or (more flexible)
connect to a joystick by index number then use functions to make event servicing channels, one for each button or hat.
'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 'ProcessEvents'.
event channels provide at least time.
event channels provide at least time. event is an interface with a 'Moment' method which returns a time.Duration.
hat channel event provides current position, (x,y) (with only one axis changing per event.)
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.)