How can use "getModifierState" on focus event with JS?
<p>I'm trying to get caps lock status on focus event of input this is my code</p>

<pre><code>$('#Input')[0].addEventListener('focus', function (key) {
                         if (key.originalEvent.getModifierState("CapsLock"))
                            //do something...
                        else {
                            //do something..
                        }
                });
</code></pre>

<p>But i'm getting this error "Cannot read property 'getModifierState' of undefined", and I don't know what I'm doing wrong. 
Some advice or link for to read thanks in advance.</p>