2

How can i disable F10 key menu bar in Firefox browser. When i working with same code for f5,f11,f12 function keys it disables corresponding browser function keys it's working but when i work with f10 it's directly focus goes to menu bar in firefox how can i disable that browser shortcut key can anyone tell me how to do this.

     function playPauseKb(event) {
         var x = event.keyCode;
         console.log(x);
        if (x == 121)//F10 paly/pause
       {
          event.data.$.preventDefault(); // this line for prevent window
          if (audio.paused) {                   
          audio.play();
          }
           else {
                  audio.pause()
                }
        } }
Jhon
  • 33
  • 11
  • 1
    Some browsers use **charCode** instead of **keyCode**. Try to use this `var x = event.keyCode || event.charCode;` – Roman Chyrva Mar 14 '17 at 12:43
  • Duplicate of http://stackoverflow.com/questions/5540549/disable-specific-function-key-using-jquery? – VDWWD Mar 14 '17 at 13:52
  • @VDWWD sorry i didn't find any answer for my question – Jhon Mar 15 '17 at 05:02
  • Hi @Roman Chyrva, I tried with your code i am not getting can you tell me another way – Jhon Mar 16 '17 at 04:55
  • Hi @Jhon, at first, please try to find charCode or keyCode, or maybe something similar to it, in your event. Add to your method playPauseKb `console.log(event)`, and look on console output. – Roman Chyrva Mar 16 '17 at 07:55

0 Answers0