Input System - How to check one of the WASD composite bindings is presed?

All code snippets and the documentation tells us how to check if the button is pressed, but I use composite WASD binding.

I couldn’t get how to check one of the WASD composite bindings is presed from the code? For expample Up or Left.

You can have multiple actions bound to the same control. For the times you want a Vector2, use your existing Movement action. For the times you want to see if they’re specifically pressing the “up” key, make a new Button type action and also bind it to the keyboard W (and gamepad joystick up, if you support both).

Or if you want to do this in your own code, just detect if the Movement action is in an “upward” direction (i.e., Y is positive and abs(Y) is greater than abs(X)) and call whatever you want to call.

Something like this:

Vector2 moveDelta = Movement.ReadValue<Vector2>();
bool upPressed = moveDelta.y > 0.0f;
bool downPressed = moveDelta.y < 0.0f;
bool leftPressed = moveDelta.x < 0.0f;
bool rightPressed = moveDelta.x > 0.0f;