The techniques generally used to detect compromising emanations are based on a wide-band receiver tuned on a specific frequency or a spectral analyzer with a limited bandwidth. However, these methods may not be optimal since a significant amount of information is lost during the signal acquisition. In this paper, we propose a straightforward but efficient approach which acquires raw signal directly from the antenna and processes the entire captured electromagnetic spectrum thanks to the computation of short time Fourier transforms. We applied this approach to detect potential compromising electromagnetic emanations radiated by modern keyboard. Since keyboards are often used to transmit confidential data such as passwords, these emanations could remotely reveal sensitive information such as keystrokes. Thanks to this method, we detected four different kinds of compromising electromagnetic emanations generated by wired and wireless keyboards. These emissions lead to a full or a partial recovery of the keystrokes. We implemented these side-channel attacks and our best practical attack fully recovered 95% of the keystrokes of a PS/2 keyboard at a distance up to 20 meters, even through walls.