use tksdl; function onJoyAxisMotion(int dev, int axis, int val) { trace "[...] onJoyAxisMotion: dev="+dev+" axis="+axis+" val="+val; } function onJoyHatMotion(int dev, int hat, int state) { trace "[...] onJoyHatMotion: dev="+dev+" hat="+hat+" state="+state; } function onJoyBallMotion(int dev, int ball, int dx, int dy) { trace "[...] onJoyBallMotion: dev="+dev+" ball="+ball+" dx="+dx+" dy="+dy; } function onJoyButton(int dev, int button, int pressed) { trace "[...] onJoyButton: dev="+dev+" button="+button+" pressed="+pressed; } if(SDL.numJoysticks) { Joystick j; int i=0; trace "#joysticks="+SDL.numJoysticks; loop(SDL.numJoysticks) { j<=SDL.getJoystick(i); trace "joystick["+i+++"]:"; trace "\tname="+j.name; trace "\tnumAxes="+j.numAxes; trace "\tnumBalls="+j.numBalls; trace "\tnumButtons="+j.numButtons; trace "\tnumHats="+j.numHats; } use callbacks; Viewport.openWindow(320, 240); SDL.eventLoop(); } else { trace "[---] no joysticks available."; }