This will restore all the windows to their previous place. In the case of some programs which keep opening multiple Windows, it is possible to close all of them by holding Shift and clicking on the X in the top right of the Windows. In many cases there is a Preference option where you decide if you want multiple windows. I am a very fast two-finger typist, but have to look at my keyboard when I type. Often, I will accidentally hit the CapLock key, and when I look at my screen, I may see several lines in upper case.
Many word processors permit changing the case after the text has been typed.
The answer to your question depends on the make of the keyboard and driver. I am using the Microsoft one, and found through Help that I have software called Intellitype. It has an option to disable the CapLock Key in Windows. On another computer, I have a programmable Gateway keyboard. In most cases, the numeric 5 key with NumLock disabled is such a key.