Fixed the joystick id usage in the joystick and game controller events.