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 264 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
      last edited by

      I got it to almost work here, if I'm understanding the issue correctly, high chance I'm not

      HiseSnippet 1356.3ocsW80aaaCDmJIJHVaFXEXXOsGz7VKrQCBR555JVZ2biS7PPye7l65VQPP.sDkMQnHEjnSpWP.F1mj8QYutuB6w8IXu2G5NJJYQYK2UDzp.3Hd28i7Gu6HuS8hEdjjDQLxp1ylDQPVenc+Ib4nNivTNZ+cQVN1X7S1W8GZmIQ3jDhOxxZ4uWo2p1Jnzm+861AyvbORgHD54BpG4.ZHUVHsW6mRYrtXexyngFVe+166I3cDLwXfKKauIJB6cNdH4HrxrkrQVqtmOUJh6KwRRBxZkcD9S5ORbIWa+yoIzALhZvVn9vDoE2Uv7ULVIE0YDk42KeOmffYoWgGXYsG3isOj5SmJuvS7QoJbKPX5OrVpL8VtD81xjdaZPuJnjkAkVQSoaY22KlFIKzn3yGXuOWRhCvfa2jJZaQKc6Us6H.K3xMBwmS5FCClhn4C1by0cgeZssiC35SjtWficO.Ofv1x8wt4HGRjcDgQBNLnYCs5Fs1ttScCTQb1YGezBQoUmhZFLc69lA0sKfx0D1whnjEhQobdxg4D1OKh8U3tptiK7jSouw8jFBdi0caLgjn9WjHgJoWPTuOLlP3MNccSH.gRwDDnrfKR+kLDmiIl323z5NWmxA0pyvIx9DFwSR76oXBPhFMRUS4LJm3FLl6IoBt63HeH2I0njlsp6bkZY0Ktltaj.4Spcdrf0L.yRHp85T8c6tXCTdlpzlu.5eYBOLykxiFKAZpC1JWbyFRxKkMZsgTbf3RRbGbBoY9TqAg8TtfY1gEybfH1sYZj.ldiPRKs5rvxTKovbr41tT2GYX6Ioud5FLBenbDn8t2sUANioP8PCfYQuQd77ywIzSaU19YfqdJukRAt87VMHlfOeF4WWLz3UEkLmyOS4mZUZBt1cAgqRbIE2LN3pm747tUdtw.WqRqpLd7zLnzPcEIyFfy2DP9uhbY4OIpkhmLNj3+TxjdwvEXjjlM1ScSj9z87GEDbM3b.M8xI65tmSlnNbTrsAAJeR5D5dm6TJuk.WJig6cA+7LZzYzKxOU9rXoMVw1JmccvL1.nbUyYosNH4n9wXqcjPRNl2rkyUN0bt1wcVUAAUpKKnvHwUpVUOM9MArIeb3.R75vkhLHrlaHTjobkK6EW4xrvpmNSxvPAeeNUdbDgunxsnrzO3seZ+cwRrpbWlLvtHRrjpnf0tjKfdGzE+pYuKI4boHBX5zbVnuDYp15YkFSc7HJT.bMacP.8xosW7a31SlNv8x1pXOLa1bA5RpubTQeHx1iHzgiL5X4aaOXXdeI0VED7ZkTLiNjGlRjZ1.2NfDHQAvNoO8WMZq4QsQFTtVYJmlckQY8E7FTtsvfxvfY34KlimunMURBKX50ux6uUxKjdOSwWjGUsV1jhqsHJVyNqFy6RN9v9u5epfi4heq7cqZqtrbQA6+P19sHBWlU29pe3upfUe9fO82mwyoRdWDCKRHcrYC.WWYVh9BCVBOkY4eFWAK0YsehsLdhK10mFDPhgU1Et1KrhbusaGgU5MnXluBMeGlPusB+wLrrbCupt7yT.2kTpKSUmjbnYoIleEv6rtfeao3sr6QkdipliKUAGgabdevwrucnt8dPTwSVPvUr69Kue9PAzOJFKo7gGhkwTHwx9nwg8gjUOBr5bUgKPl0RpiQ5wapFq7.8Ib+zAuFdxTtkZrUlxsxUhBwdwhy7zUPTecxZoR.NwS+vrZ1GpF6tEJsphoeND9Xoy77JOUyA7d2Tfe4ME38uo.+paJvGbSA902TfO7+Gn5aYexXoHTerAgNr2dokjsr1iqZYJMaE8e.G1gEK
      

      The issue now is the callback is triggered immediately when the label is 're-interacted' with

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

        @rglides What is Enter here? I don't see it declared anywhere

        if (key == Enter ...
        

        Edit: Actually that keypress callback doesn't look valid, you should only get one parameter which would be event.

        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 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

                              24

                              Online

                              1.9k

                              Users

                              12.2k

                              Topics

                              106.6k

                              Posts