Use window.onblur instead of document.onvisibilitychange to detect when to clear the modifier keys state (#2)