some functions for gamepad detection