Is there any way that you could wear a mask while you are sleeping so this wouldn't happen again?

Years ago I scratched my cornea and it did heal fairly quickly, but it was oh, so painful!