Helper for input remapping in settings menus. Listens for the next key press or gamepad button and returns it.
Wait for the next gamepad button press. Returns the button index as a string (e.g. '0', '1', '2').
Wait for the next keyboard key press. Returns the key name (e.g. 'UP', 'SPACE', 'A'). Call cancel() on the returned handle to abort.
Helper for input remapping in settings menus. Listens for the next key press or gamepad button and returns it.