HISE Logo Forum
    • Categories
    • Register
    • Login

    How to trigger label callback on enter/return but not on focus change?

    Scheduled Pinned Locked Moved Scripting
    labeltextvalueupdatefocus
    23 Posts 5 Posters 437 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rglidesR
      rglides @d.healey
      last edited by

      @d-healey Enter is for the setConsumedKeyPresses right? Guessing I'm wrong but I thought the method was setConsumedKeyPresses("Enter") and then if key == Enter, do I not need to do this? seems to work for me

      d.healeyD rglidesR 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @rglides
        last edited by

        @rglides said in How to trigger label callback on enter/return but not on focus change?:

        Enter is for the setConsumedKeyPresses right?

        Not unless you define it. Your if statement is currently the equivalent of

        if (key == undefined ...
        

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        1 Reply Last reply Reply Quote 0
        • rglidesR
          rglides @rglides
          last edited by

          @rglides Ha! yeah, I changed it to if (Label1.get("editable")) and it works, ok little lesson learned. Still, this works, almost

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @rglides
            last edited by

            @rglides said in How to trigger label callback on enter/return but not on focus change?:

            if (Label1.get("editable")

            The label is always editable isn't it?

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            rglidesR 1 Reply Last reply Reply Quote 0
            • rglidesR
              rglides @d.healey
              last edited by

              @d-healey Sure, but for some reason it has allowed clicking outside of the label and not triggering the callback

              d.healeyD rglidesR 2 Replies Last reply Reply Quote 0
              • d.healeyD
                d.healey @rglides
                last edited by

                @rglides said in How to trigger label callback on enter/return but not on focus change?:

                @d-healey Sure, but for some reason it has allowed clicking outside of the label and not triggering the callback

                It's still triggering it here. Add Console.print("test"); inside the if statement, you can remove all the update panels stuff, it's just complicating the picture.

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                1 Reply Last reply Reply Quote 0
                • rglidesR
                  rglides @rglides
                  last edited by

                  @rglides uggggh, ok, HISE has defeated me yet again, my logic was to start with an if statement to see if the callback could be avoided, so I thought I had it. Turns out the callback just won't trigger at all regardless of the if statement, until the label is re-interacted with (or when hitting enter) so I have proved useless again. But I tried, and it was fun to feel like I figured something out, briefly

                  d.healeyD 1 Reply Last reply Reply Quote 1
                  • d.healeyD
                    d.healey @rglides
                    last edited by

                    @rglides said in How to trigger label callback on enter/return but not on focus change?:

                    I tried, and it was fun to feel like I figured something out, briefly

                    You've done no worse than my attempt :)

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    rglidesR ChazroxC 2 Replies Last reply Reply Quote 1
                    • rglidesR
                      rglides @d.healey
                      last edited by

                      @d-healey Thank you. This really should just be a core feature, it seems like basic stuff

                      1 Reply Last reply Reply Quote 1
                      • ChazroxC
                        Chazrox @d.healey
                        last edited by

                        @d-healey @rglides this is a crazy one. lol I'll def try again.

                        rglidesR 1 Reply Last reply Reply Quote 0
                        • rglidesR
                          rglides @Chazrox
                          last edited by

                          @Chazrox fr

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          15

                          Online

                          1.9k

                          Users

                          12.2k

                          Topics

                          106.7k

                          Posts