gamepad support, keyboard handling cleanup