-1

I am working on an application where I need to detect whether user has pressed ctrl+f6 for certain navigation path. How to capture ctrl+f6 key press event in javascript/jquery?

Misha Akopov
  • 11,071
  • 26
  • 66
  • 81
Sayantan Ghosh
  • 836
  • 2
  • 9
  • 27

1 Answers1

2

Hope this helps (source)

$(window).keydown(function(event) {
  if(event.ctrlKey && event.keyCode == 117 ) { //f6 keycode
    console.log("Hey! Ctrl + F6 event captured!");
    event.preventDefault(); 
  }
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Hit Ctrl + F6 to see console log on this event.
Krzysztof Janiszewski
  • 3,630
  • 3
  • 16
  • 35