I’m just learning JavaScript right now, so please do try and explain with that detail in mind.
What I want to do is this exactly — when a user right-clicks or uses contextmenu from keyboard, I want to know what option they selected in the contextmenu. Mainly I want to know if they selected ‘paste’ or not. I know that there is an onPaste event-handler but I’m looking for another approach.
There is no way to read the context menu from JavaScript. The best you’ll be able to do is to infer the user’s selection by listening to other events. That could be messy.