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 perform some action only when 'context menu key' is pressed on the physical keyboard. How do I achieve that?