Things you didn't try:
1. External keyboard (easy!)
2.New internal keyboard (more work and more expensive) if the external keyboard is fine.
3.Back to factory conditions (unless that's what you mean with "refreshing", but system restore after going back to factory conditions is somewhat futile, so rather strange).
4. New motherboard if both the internal and external keyboards fail in factory conditions.

Kees