Disable Shift-Click Knob Text Box
-
@Christoph-Hart thank you! Once I call
const var mods = Knob1.createModifiers();can I use the same logic for multiple knobs? Or does it have to be one set of .createModifiers per slider?
-
@tomekslesicki One per slider, but you can reuse the same object. You could also do it in a single loop which would apply it to all sliders in your project.
-
@d-healey ok, so that I understand it correctly - I call createModifiers() once, and then loop through the sliders with .setModifiers, right?
-
@tomekslesicki Yes that's my understanding, the
createModifiersfunction should return an object you can pass insetModifiers- let me know if it works. -
@d-healey it does, thank you!
-
@Christoph-Hart @d-healey @tomekslesicki
Well i tried the Doc example, how I can remove the shift click command, so no input text at all!
Content.makeFrontInterface(600, 600); const var Knob1 = Content.getComponent("Knob1"); const var mods = Knob1.createModifiers(); // We want to reassign the reset double click to shift + double click Knob1.setModifiers(mods.ResetToDefault, [ mods.doubleClick, mods.shiftDown ]); // and the text input to a double click without modifiers. Knob1.setModifiers(mods.TextInput, [mods.doubleClick, mods.noKeyModifier]);HiseSnippet 991.3ocsV0saaTDEdVmrAhApnn9.LpW4.Qt10IwIBPID6jhUvoV0osHgPUi24rwi7tyrZmYahaE2wyCuB7Xv0HdA3M.NyrqiWSRSZsD6EV64+u8Lmy23Aop.PqUoDupmMMAHdep+voRy3NiYBIoWWh2876yzFHklq5voILsF3DOuUdhUg25qRbO+89GxhXx.XtJB4EJQ.7ChXgYt1AGbhHJ5XFGNSDWx6sNnWfR1QEoxP7rheCRBKXB6b3Tl0sJ9jumoGS79R+1M1qQKXus4.q0ts1tYC1dsC2pEuAeDqMe2G2Hb6cF0FBIdqcDWXToCMLCnwjdnhOc3X0Ex7B7BgVLJBrBMICwJmqlzYrHhOXVyQSHdqNXdqZk7V0C76K3hqzOuk84NCz4QTto4U41fTyO.H4UBRqlCo66OLHUjXlawhmOwumDOACY3YSYnj6Kox2TwuiB8PZpGyl.GmhBWEQscZzXSJ9yFecU7AOgzF5qYozSjpQMoeKcVnmClNp3DkDEp8Pm0GhwLOfXEWi96rTOHEvu+9JtHT.o5Z1r+nGQeIPufIMTihhNn0hykTyX.EzfgxUYXqgFDIBlXcQOVDZne0B5qlmez84I2V45OylhyTcgPVVjYS5O4.T87X6XCcybMtr1EOPn+bApXRtCEF3RCUHSxb.jsHdtPXFqPKwyJa82ITNCySOaZPT7N.gTcBLcVXHNByjAFgRRUxSUF3oxZaT8sUWu5uTk9eMEFdi1rmSopnHH8FMa2ESus.qIyhGAoahmkQYvUNhydKNPu162.cP9XSIGUxdRg4oIPg7wpHtcP0990G+IEyc1EgBDhtZbqA2qXMXXjfCoDAljOx2cXPbfufy4fp+wesO4485xLrYoAyHVkDH0HreLdcgWiLX4aWq62EzSLpDmuEi5Hk4cVzKId9dXIHSsurA9h1L01RVy4.IVv4Qv.kVXa4knT+cj4MYn3MND+1G7aO4OeyutebYVWBIlcYYRXcVXn3RGcYnHJVaPL0KFYQIdeg+y0.kmu.P0Sv7DIjS.9YJm+jqSnfTYJdVDyrH+lk4uvfEvkIUrDGR7CYZYP8AP503VI8deg388GHLAiuYLV4FvHd9++AFKtp3y7OJLDBLyA3p9G+iK68B2Q4eFxBIjm2mgG81IuSyhGhWoF.X0kRHRaGBqX2fxkaXkscfgfj6D9G7ovXSqrWgwlyLhCcAopWEju2YuL5icZPLIcWVuN9uFPY5hKb4yq3ciuJHXwTcs.e7xFXqkMvsV1.2dYCbmkMv1Kaf6d2AZ+qKeWlQEmu1PH8Gbjifzy6HICm.cSqj+E4xs4IA -
@tomekslesicki @Christoph-Hart @d-healey
is this correct?Knob1.setModifiers(mods.TextInput, [mods.disabled, mods.disabled]); / No text input Knob1.setModifiers(mods.ResetToDefault, [ mods.disabled, mods.disabled ]); / No Double click to Default -
Seems to work, can we use a loop for this? @d-healey
-
This post is deleted! -
@ILIAM
I did not try your code but if it works, it will also work in a loop like this:const knobs = [Content.getComponent("Knob1"), Content.getComponent("Knob2")]; for(k in knobs) { k.setModifiers(mods.TextInput, [mods.disabled, mods.disabled]); / No text input k.setModifiers(mods.ResetToDefault, [ mods.disabled, mods.disabled ]); / No Double click to Default }; -
@Oli-Ullmann said in Disable Shift-Click Knob Text Box:
mods
Okay, but what about
const var mods = Knob1.createModifiers();? -
@ILIAM
Phew, unfortunately I'm not familiar with this topic. I'll take a look when I have time. But maybe someone here knows something about it. :-) -
You can use an array and loop over the knobs array.
const mods = []; for (x in knobs) mods.push(x.createModifiers()); -
@d-healey said in Disable Shift-Click Knob Text Box:
const mods = [];
for (x in knobs)
mods.push(x.createModifiers());Thank you
-
@d-healey But i see an error"
const var knobs = [Content.getComponent("Knob1"), Content.getComponent("Knob2"), Content.getComponent("Knob3"), Content.getComponent("Knob4"), Content.getComponent("Knob5"), Content.getComponent("Knob6")]; const mods = []; for (x in knobs) mods.push(x.createModifiers()); for(k in knobs) { k.setModifiers(mods.TextInput, [mods.disabled, mods.disabled]); // No text input k.setModifiers(mods.ResetToDefault, [ mods.disabled, mods.disabled ]); // No Double click to Default }; -
-
@d-healey
const mods = []; for (x in knobs) mods.push(x.createModifiers()); for(k in knobs) { k.setModifiers(mods.TextInput, [mods.disabled, mods.disabled]); // No text input k.setModifiers(mods.ResetToDefault, [ mods.disabled, mods.disabled ]); // No Double click to Default };Interface:! Warning: undefined parameter 0 : Line 17, column 19 {SW50ZXJmYWNlfHwzMTB8MTd8MTk=} Interface:! Warning: undefined parameter 0 : Line 18, column 19 {SW50ZXJmYWNlfHwzOTZ8MTh8MTk=} Interface:! Warning: undefined parameter 0 : Line 17, column 19 {SW50ZXJmYWNlfHwzMTB8MTd8MTk=} Interface:! Warning: undefined parameter 0 : Line 18, column 19 {SW50ZXJmYWNlfHwzOTZ8MTh8MTk=} Interface:! Warning: undefined parameter 0 : Line 17, column 19 {SW50ZXJmYWNlfHwzMTB8MTd8MTk=} Interface:! Warning: undefined parameter 0 : Line 18, column 19 {SW50ZXJmYWNlfHwzOTZ8MTh8MTk=} -
@ILIAM That's telling you that the parameter you're passing to a function on line 17 and 18 is undefined - in this case
modsmodsis an array, you need to get the individual mod object from the array for each knob. -
@d-healey So Loop doesn't works?
-
@ILIAM Yes, but you'll need to modify it to access the mods. Probably a for loop rather than for in.