TextEditor: disable right-click?

Hi!

My goal is this: I do NOT want my TextEditor to get activated, when the user clicks on it with the right mouse button.
It should only get activated, if the user clicks with the LEFT mouse button on it.
The reason is: I want to show a custom popup menu, when the user right-clicks.

This was astonishingly awkward to achieve. I had to override the following four functions in the TextEditor:

  • mouseDown
  • mouseUp
  • focusGained
  • focusLost

And now I am wondering:
Is there a nicer solution? Something more elegant?
Which does not require to override that many functions?

BTW: I realise questions similar to this get posted from time to time.
For example here: Get rid of right-click clicking
@JUCE team: Maybe something to look at? :slight_smile: