How to differentiate between 'right click using mouse' AND 'context menu key press on physical keyboard'
问题 How do I differentiate between right click using mouse and context menu key press on a physical keyboard? Using this code I tried printing event in console $('#'+inputId).bind('contextmenu', function(e) { console.log(e); }); I grabbed some output for the above code- For right click using the mouse it is- button: 2 originalEvent: MouseEvent type: "contextmenu" which: 3 For context menu key press on the keyboard it is- button: 2 originalEvent: MouseEvent type: "contextmenu" which: 3 I want to