Need help with virtual joystick controller and keyboard controller

i’m modifying Touchscreen Joypad Controls from tutorial and adding keyboard controller
my project =

the script is work fine with =
key w: move up
key w +a = move up diagonal right
key w + d = move up diagonal left
key a = move left
key d = move right
key s: move down
script did not work as intended with =
key s+a = should be move down diagonal left instead move down diagonal right
key s+ d =should be move down diagonal right instead move down diagonal left
i need help with the script, all help will be appreciated thank you