added some  gamepad and mouse code