Double-click / Shift-Click on GUI object

hey there,

is there a way to tell, if a GUI-object (i.e. a knob) has been

a. double-clicked
b. shift-clicked

upon? :slight_smile:

thank you!!!

Hi, yes you can do both! Please bear with me for this indirect answer, I’ll also put a direct one below :slight_smile:

w = View(bounds:400@400).front;
w.mouseDownAction = { |...args| args.postln }

Try to click on the window, shift-click, ctrl-click, double-click, shift-alt-ctrl-double-click, and see how the arguments change. You have all the info you need there, please check this link for more details: View#Mouse actions.

Then the direct answer to your question :

w = View(bounds:400@400).front;
w.mouseDownAction = { |view, x, y, modifiers, button, count| 
    if (modifiers.isShift) { "SHIFT click".postln };
    if (count == 2) { "DOUBLE click".postln };
}
3 Likes

perfect, thank u so much!

1 Like