Turn off atom-pane context menu

How do you turn off the context menu that appears when right mouse clicking a package pane? I’m trying to disable it so that right mouse clicking trigger another event in my package pane without the context menu appearing.

You could try the oncontextmenu HTML attribute as discussed here and here, or the technique described here to catch the context menu event.

Even after I used e.preventDefault(), the context menu of Atom still appears after right clicking. I think its because Atom’s context menu is managed by a separate package and not the default one?

Then you might have to find that code and find out how to override it, but only sometimes. Seems like that could be a lot of work and I wouldn’t know where to start.