Differentiating device used for input in script?

How can I differentiate between which type of input was used to send the same command? For example I have both mouse delta and right analog stick (on the same player currently) set to the Look Action. I’m trying to make an if statement that basically separates them applies the correct sensitivity.

Here’s a half psuedo-code example of what I’m trying to do.

public void OnLook(InputValue value, ???? device){
        if (device = Mouse) {
            playerMovement.lookX = value.Get<Vector2>().x * playerMovement * mouseSens;
            playerMovement.lookY = value.Get<Vector2>().y * playerMovement * mouseSens;
        } else if (device = Controller) {
            playerMovement.lookX = value.Get<Vector2>().x * playerMovement * controllerSens;
            playerMovement.lookY = value.Get<Vector2>().y * playerMovement * controllerSens;
        }
    }
1 Like

Use control scheme to do that, it’s what I’m doing for pretty much the same reasons (sensitivity and per-device adjustment) and it’s working fine. You can know which scheme is used with PlayerInput.currentControlScheme

1 Like