Swap out your keyboard for a different one (or plug in an external if you’re on a laptop). If the problem goes away, you’re golden. If not, you have a problem with your machine.
Hmm, from what I can tell from your post the problematic keys are W, S, X, and A (how about Q and Z?). Which all lie in adjacent columns. Since the electronics detect each keypress by its row and column (example herefor anyone who’s interested), it seems to me suggests to me that there’s some sort of hardware fault, perhaps a short circuit between the two columns?
My guess is keyboard as well. It would be very odd for this to be a software issue, or even a hardware issue external to the keyboard (though I’d call this more likely than the OS).
I’ve had weird stuff like that happen after a spill. When it started, you weren’t drinking coffee by any chance, were you? Usually just goes back to normal once it dries.