Were you able to resolve your problem? If not, would you be willing to restate what your problem is? For example “I am trying to count each time that the mouse [does something / is doing something]”.
I’ve looked at the original solution post that you reference – Solution for repeating keyPressed while holding key - #11 by vincentstrebelle – and I’m still unclear on what you are trying to do. It seems as if you could simply duplicate the mouseRight code for both buttons and your problem would be solved?
Another option is to just put all your code in mousePressed()
and use mouseButton.
If you are counting clicks and don’t care about the attack vs. release, it is also even easier to just put the code in mouseReleased and check mouseButton. Then no boolean guard fields are necessary – you can do the whole thing in 5 lines of code.