Keyboard Input does nothing when Gamepad is present at game start

I’m not sure I understand the best practices for simultaneous keyboard and gamepad inputs. This is my menu input. The idea is that either keyboard or gamepad should work. I have a PS4 controller connected to my computer via USB.

When I start a game, the keyboard inputs don’t work. The gamepad inputs do work (although they don’t work perfectly, they seem to register a press every frame, but that might be a bug in my input repeat code since it continues if I unplug the controller).

However, if I start the game with the controller unplugged, the keyboard controls do work. If I plug the gamepad in while the game is running, both gamepad and keyboard work (the every-frame behavior still happens but at least I can tell it’s registering the gamepad input).

This is the component that has access to the player input component.

    void Update() {
        if (input.enabled) {
            InputRepeater repeat = gameObject.GetComponent<InputRepeater>();
            InputAction ia = input.actions["Cycle Down"];
            if (ia.triggered && ia.phase == InputActionPhase.Performed) {
                repeat.Set(OnCycleDown);
            }
            if (ia.triggered && ia.phase == InputActionPhase.Waiting) {
                repeat.Clear();
            }

            ia = input.actions["Cycle Up"];
            if (ia.triggered && ia.phase == InputActionPhase.Performed) {
                repeat.Set(OnCycleUp);
            }
            if (ia.triggered && ia.phase == InputActionPhase.Waiting) {
                repeat.Clear();
            }

            ia = input.actions["Cycle Left"];
            if (ia.triggered && ia.phase == InputActionPhase.Performed) {
                repeat.Set(OnCycleLeft);
            }
            if (ia.triggered && ia.phase == InputActionPhase.Waiting) {
                repeat.Clear();
            }

            ia = input.actions["Cycle Right"];
            if (ia.triggered && ia.phase == InputActionPhase.Performed) {
                repeat.Set(OnCycleRight);
            }
            if (ia.triggered && ia.phase == InputActionPhase.Waiting) {
                repeat.Clear();
            }

            ia = input.actions["Accept"];
            if (ia.triggered && ia.phase == InputActionPhase.Performed) {
                OnAccept();
            }

            ia = input.actions["Cancel"];
            if (ia.triggered && ia.phase == InputActionPhase.Performed) {
                OnCancel();
            }
        }
    }

Here’s the input component on the same gameobject:

I’m on the latest version of Unity. What am I doing wrong?

Found the answer at https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.PlayerInput.html:

"If control schemes are present in actions, then if a device is used (not merely plugged in but rather receives input on a non-noisy, non-synthetic control) which is compatible with a control scheme other than the currently used one, PlayerInput will attempt to switch to that control scheme. Success depends on whether all device requirements for that scheme are met from the set of available devices. If a control scheme happens, InputUser signals ControlSchemeChanged on onChange.

If no control schemes are present in actions, PlayerInput will automatically pair any newly available device to itself if the given device has any bindings available for it.

Both behaviors described in the previous two paragraphs are automatically disabled if more than one PlayerInput is active."

I had more than one PlayerInput in my scene.