Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger f11 event of keyboard using javascript or jquery?

I want to trigger f11 event of keyboard using javascript or jquery, can anyone tell me how to do this ?

like image 417
Ravinder Singh Avatar asked Nov 24 '11 07:11

Ravinder Singh


3 Answers

You can try using this one: http://andrew.hedges.name/experiments/fullscreen/

like image 122
jacoor Avatar answered Oct 22 '22 11:10

jacoor


You can't make people's computers type things through javascript. It violates the sandboxing environment of browsers. I assume that you are trying to make a window go full screen though. This SO question covers that.

How to make the window full screen with Javascript (stretching all over the screen)

like image 34
mrtsherman Avatar answered Oct 22 '22 13:10

mrtsherman


I'm use this code:

function go_full_screen(){
  var elem = document.documentElement;
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.msRequestFullscreen) {
    elem.msRequestFullscreen();
  } else if (elem.mozRequestFullScreen) {
    elem.mozRequestFullScreen();
  } else if (elem.webkitRequestFullscreen) {
    elem.webkitRequestFullscreen();
  }
}
<a href="#" onClick="go_full_screen();">Full Screen / Compress Screen</a>
like image 36
Santos L. Victor Avatar answered Oct 22 '22 12:10

Santos L. Victor