Recycle Bin Button

I have the recycle bin as a button on a toolbar is there a way to get this right click menu when i right click it
image

Change the function to Go /trash CONTEXT

Thankyou that works great.
I have just found this button in the forum Empty Recycle Bin (with icon matching state)
Is it possible for you to modify this button for me
Left click : Go /trash CONTEXT
Right Click : Empty Recycle Bin

Interesting function! Seems to be undocumented :thinking:

Just realized the modification would not work properly, would need to be something like :
Left click : Go /trash CONTEXT
Right Click : would bring up the context menu
SHIFT + Right Click : Empty Recycle Bin
Is this possible ?

That combination is impossible with Shift + Right-Click, but you can do it with Shift + Left Click:

@keydown:none
Go /trash CONTEXT
@keydown:shift
Delete EMPTYRECYCLE

It's used behind the scenes by things like Go DRIVEBUTTONS, for the buttons it auto-generates.

I think it's undocumented because it can cause problems if you use it in things like three-buttons, which already have right-click actions.

FWIW, in the future we're going to make buttons that run a simple "Go <path>" automatically have right-click context menus, as well as middle-click to open in a new tab, without requiring any extra arguments, as long as they're on buttons that don't define any other right/middle-click actions. So it'll probably stay undocumented, since it should become unnecessary. (We don't plan to break it either, though, so it should be safe to use now if you need it!)