RightClick on toolbar button?

Hello,
I would like my_button on toolbar runs code at leftClick and loads OpenFileBox at rightClick.

But I find nothing in UI::Command API to do such. Do I miss something?

Regards

The UI::Toolbar and UI::Menu classes do not provide ways to respond differently to left- and right-clicks, in fact they don’t respond to right-clicks at all.

… or middle clicks.


But wish we did have these proc settings.

Meanwhile, just make a toolbar with two buttons… or a menu/submenu with two equivalent items…
It is NOT a show stopper.:confused:

Thanks all

I was just dreaming about but two buttons are going to make the job!

Have a good week-end

It is possible to use a timer and detect a double click on a button. in some of my custom toolbar methods for toggling line styles for example a "toggle line extensions " button would bring up a dialog to set the extension length when double clicked. But it’s very unconventional.

Never thought timer could do. nice way!

In fact it’s just a shame as it looks like toolbar buttons respond to MouseDown and MouseUp events. So MouseButton is their friend but extension development need me to forget about Ms reflexes which is a bit hard on daily basis!

I could have felt more comfortable with a small plugin able to run more than one script on the same button. I was thinking about LeftClick running the previous script or RightClick showing 8 items. The first one would launch OpenDialog box following by seven items of the recent scripts. too bad!

Please tell me. How do I receive an e-mail when post added? I do not find anything and BottomWatchingButton doesn’t do!

There are settings in your profile. Click your avatar at the upper right of a page, then click the little gear-like icon to edit your profile. Scroll down and look for the checkboxes to register your email and activate notifications.

I don’t think using a hack to detect double click or having Trimble adding Procs for other interaction than left click is a good idea. People are used to toolbar buttons functioning a certain way and breaking that convention will just makes thing harder to understand.

Hello,

I agree with you! aming extension user any hack breaking SketchUp convention is bad idea and I won’t do but I find jim_foltz’s tip amazing! it may help any personal script working locally.

have a good week