Racing Game

I want to make a 2 player racing game but am having problem with key presses. I want asdw to be the keys 2nd player uses to move but don’t know how to check for those key presses. I’ve tried to get the ascii values and do it like that. But when I do get the ascii values it gets both what player 1 is pressing and player 2 is pressing and the ascii check fails. How else can you check for key presses of letters?
sorry if im not really clear