Modifier Keys || Shift + Click = DoSomething
-
What I want to do is set this for a label (text input).
if (Shift + Click)
Button1.setValue(1);-- After user presses enter while focus is on a text label, Im going to clear the text field and need to set a button value to 1.
Please advise. I've read the docs on this but im not sure how to use the modifier api's in an if statement.
-
@Chazrox Can you clarify, do you want shift + click followed by enter to do the action. Or shift + click does the actions, or enter does the action? Or something else?
-
@d-healey damn, sorry im brain fried. I just asked 2 questions at once.
lets just worry about the enter thingy. haha..
When I press enter on some text input on a label, I want it to trigger 'SaveButton'.
- Select label
- enter text
- press enter
- execute 'save' action
- empty text field
-
@d-healey long nights.
-
@Chazrox said in Modifier Keys || Shift + Click = DoSomething:
I want it to trigger 'SaveButton'.
You want it to trigger the button or the save action?
You probably just need this
inline function onLabel1Control(component, value) { // Do what you want here }; Content.getComponent("Label1").setControlCallback(onLabel1Control);
-
@d-healey oh shoot. I didnt even think to do a callback with a label. So is 'Enter" already an available function? I dont see it under 'scripting label' in docs.
Thats def a modifier function im assuming. Which brings me to my other question. Modifier keys?
-
@Chazrox said in Modifier Keys || Shift + Click = DoSomething:
So is 'Enter" already an available function?
It's the default behaviour, when you hit enter it will trigger the label's callback
@Chazrox said in Modifier Keys || Shift + Click = DoSomething:
Modifier keys?
Content.setKeyPressCallback()
- It's a little finicky to use, you should search the forum for information because I can't remember :pIt's on my list to make a video about it.
-
@d-healey said in Modifier Keys || Shift + Click = DoSomething:
It's the default behaviour
Perfect.
That should do the job.
I think thats a great video idea! I think it adds to the possibilities for some fun use cases if its easy enough to implement.
Things that come to mind for some of my own projects... :
Shift + Click = Solo / Isolate
Shift + Click = Reset all similar components to 'Default' state/value
Ctrl + Click = Copy --> value
Ctrl + DoubleClick = Pasta ---> value -
@Chazrox said in Modifier Keys || Shift + Click = DoSomething:
Shift + Click = Solo / Isolate
Yeah I added this to my mixer script recently.
-
@d-healey See, thats what I need to. lol I think alot of people would like that one.
-
@d-healey can you see this?
pressing enter after typing text doesnt trigger callback.
inline function onPresetNameToSaveControl(component, value) { if (value) // Is this correct/enough? { SaveOk.setValue(1); // Save Button SaveOk.changed(); } }; Content.getComponent("PresetNameToSave").setControlCallback(onPresetNameToSaveControl);
-
@Chazrox said in Modifier Keys || Shift + Click = DoSomething:
if (value)
This isn't a button callback, no need to check the value.
Why are you triggering the save button? Do you need to do that?
You can put your save functionality into a function and call it from the button and from the label.
-
@d-healey ok. I see. Let me changed it around and try this again.
-
@d-healey
Thank you sir.
now about this video...? I need that info now! haha.
-
@Chazrox It's too hot here to record videos, have to wait until next week once I've stopped melting
-
@d-healey damn I feel you. Its hot in LA rn too. Ok. I'll wait. ha
-
@d-healey Maybe you can help me do this one and I can figure out the rest.
From what I have now, 'enter' executes my 'save' function. I want 'Shift+Click' to run my 'rename' function.
-
@Chazrox shift click on the label?
-
@d-healey yes. Shift+Enter = doSomething();
-
C Chazrox marked this topic as a question
-
@Chazrox From what I understand, this should work
HiseSnippet 968.3ocsVEtaaaCDlxIpnRacXEnO.D8OyYnv0N1wMoACqKN1qFsN0XtqX.CEEzTmrIhDofHURMJx6vd416QeC5NJIGK2D31ZfIXXvi2cje7638IMNUwAsVkRb7e8hDf378tSVHMy6MmIjjgmRb9A2QLsARoEScxhDlVCADGmc9c6DNd6Rxe93udBKhI4vpoHj2nDb3khXgY0rie1KDQQCXAvqEwUhtyyFxUxdpHUFhmcbaRRX7yYyfyX1vp4RdNSOm37ytGreadmfmDr+9GbTWNqKbTHKLrU6fNc5d3QsZeDqygcglGPbtS+.gQkNwvLfFWzSTAKlLWcorXCdiPKlFAViVjI3NWLMo2bQTv3kjilPb1c7JpZmBp5AtiDAhqmeEk8i4NnqxnJo4TaSPp02.jbp.ocKfz8cmvSEIlUdr346bGJwJXHCqMUgRQrjZ+aM2dJLBooQL6bXPJZbcF061r4in3e6cruOVezF5ErT5KYSgnVzegtLyYfomJNQIQi5Orv8Cs4TLrg15WpyhgfW.KFmhvCz0+6ObNrnmJ.dJsU6qd6dGSe7iwQ3512B.J5s5JrLydrnno3ki5gYRtQnj0gKv8cO+O36IBoEVMD5AJdlFKLxYvd9ddofIKUdLNpZX54hPLUOLWOKDUQPijTg8XLw5hJzz.r9XOMdW46AQZXyQmkTFqumYtP2fmiff5EGumyt.nFEMlIyvywBpIULaFdXMyAJxvlTUDkWdBoR0kzo.mkoA5kvOkBTgbYT9WYIXgLRHA5RpfpjEDVuhfpyWVVdDV4hxfbVx+JLyMW6JKY103Z99yVab6qrsmoLvqj0KWee5m6JL7V8UtVQP5s51JRjtoDqKyhmBoqe57oXSw5cZ24qqSiWPJUBTIGJElWk.k1CTQA1NH63a1WRJYUbzeN7TlgYaUKmCiKARMBKbbNEt.EGKZb8bOEzmaTI4wVVJHNtlbu2qrsNm6IBbquqaQcf7dLHm+A2qE1AivAF38Fa.5fP7GJ2dCUBTeREjEwLqKZYkyKcf76ZJEV0.oVXVTUt+aPIq4FUx9Zg38cGKL742NFqcKXDY9+OvXo9+8b6GFBbyJ.tq6f+ZaE6+Ba+enxLB4rQLTrvVyOKKdB9dRNXU2jnjjs7Wyd6qvto01x.S.YPtwmvmRmsr1NkNaszIIlwSUuqTaw9Fl6lOChIY9af8vOE.sosH4cZU44X7EduiyWeotQh6usI1daSry1l3Aaahc21Dex1l3ge4DseOxukYTwEsMDxnw8yklbb5KY3Mv7aqj+Cf1idmL
But it doesn't. It looks like when the event is the enter key it won't work while shift is down - at least not on my system. Maybe Christoph has an idea.