i assume it's on a laptop....
In about 98% of the cases in which the keyboard partially stops working it's because something was spilled on it. Other 2% it's defective lol
You most likely will need to replace it... I can't think of any software issues that would cause this. I've never seen a virus or anything damage the keyboard.
OR you could have changed the keyboard languages. But you said, "not working" not "writing things they're not supposed to." lol