I use this code below to count how many times does the user press F11 (on Chrome). When I press F11 to go full screen, the variable countF11 increases 1, but it doesn't change when I press F11 to exit full screen. What is the reason and is there a solution for this?
var countF11 = 0;
document.onkeydown = function (e) {
if (e.keyCode == 122) {
countF11++;
document.getElementById("status").innerHTML = countF11;
}
}