title: How do you tell if caps lock is on using JavaScript?
body: <p>How do you tell if caps lock is on using JavaScript?</p>
  
  <p>One caveat though: I did google it and the best solution I could find was to attach an <code>onkeypress</code> event to every input, then check each time if the letter pressed was uppercase, and if it was, then check if shift was also held down. If it wasn't, therefore caps lock must be on. This feels really dirty and just... <em>wasteful</em> - surely there's a better way than this?</p>