Implement events for linux joystick and SDL APIs. Fix compile on linux.