API Docs for: 3.8.0

event-contextmenu Module

Provides extended keyboard support for the "contextmenu" event such that:

  • The browser's default context menu is suppressed regardless of how the event is triggered.
  • On Windows the "contextmenu" event is fired consistently regardless of whether the user pressed the Menu key or Shift + F10.
  • When the "contextmenu" event is fired via the keyboard, the pageX, pageY, clientX and clientY properties reference the center of the event target. This makes it easy for "contextmenu" event listeners to position an overlay in response to the event by not having to worry about special handling of the x and y coordinates based on the device that fired the event.
  • For Webkit and Gecko on the Mac it enables the use of the Shift + Control + Option + M keyboard shortcut to fire the "contextmenu" event, which (by default) is only available when VoiceOver (the screen reader on the Mac) is enabled.
  • For Opera on the Mac it ensures the "contextmenu" event is fired when the user presses Shift + Command + M (Opera's context menu keyboard shortcut).