HISE Logo Forum
    • Categories
    • Register
    • Login

    Return the old Content.setKeyPressCallback functionality (that we had for a few days)

    Scheduled Pinned Locked Moved Feature Requests
    38 Posts 5 Posters 2.4k 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.
    • ulrikU
      ulrik @Christoph Hart
      last edited by

      @Christoph-Hart said in Return the old Content.setKeyPressCallback functionality (that we had for a few days):

      The new way is now checking for keypress matches before calling into any script, then returns true if the registered keypress matches (all within C++) and kicks off the asynchronous script callback, which is much more stable.

      But a catch-all string might work, but can you elaborate the use case you're after?

      Ok this broke a lot in my projects, so it says

      Skärmavbild 2024-05-10 kl. 12.46.07.png

      Does this mean I have to list every character I'm going to use in the specified keypress callback?
      like

      const consumedKeys =
      	[
      	"a", "b", "c", etc........];
      

      It is a callback for user search presets

      Or how do I setup a "catch-all" string? (I guess this string will cover all

      Hise Develop branch
      MacOs 15.3.1, Xcode 16.2
      http://musikboden.se

      A d.healeyD 2 Replies Last reply Reply Quote 0
      • A
        aaronventure @ulrik
        last edited by

        @ulrik you can do pass in cosumedKeys = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");

        and follow up with any special keys you want to use

        consumedKeys.concat("Escape", "Backspace", "Return", "Delete");

        Christoph HartC 1 Reply Last reply Reply Quote 1
        • Christoph HartC
          Christoph Hart @aaronventure
          last edited by

          @aaronventure Or just use setConsumedKeyPresses("all") :)

          Throwing a compile error when you don't call this method is an entirely educational measure, but I think it's better if people run against a compile error that requires their attention instead of silently changing the behaviour (because here the implications are very subtle and not obvious).

          ulrikU 2 Replies Last reply Reply Quote 2
          • ulrikU
            ulrik @Christoph Hart
            last edited by ulrik

            @Christoph-Hart said in Return the old Content.setKeyPressCallback functionality (that we had for a few days):

            @aaronventure Or just use setConsumedKeyPresses("all") :)

            this will throw an error
            and the project will not compile

            Hise Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

            1 Reply Last reply Reply Quote 0
            • ulrikU
              ulrik @Christoph Hart
              last edited by

              @Christoph-Hart sorry, I opened it with an old compiled Hise app,
              indeed it work, thank you @aaronventure and @Christoph-Hart !

              Hise Develop branch
              MacOs 15.3.1, Xcode 16.2
              http://musikboden.se

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

                @ulrik New docs - https://github.com/christophhart/hise_documentation/blob/master/scripting/scripting-api/scriptpanel/setconsumedkeypresses.md

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

                ulrikU 1 Reply Last reply Reply Quote 1
                • ulrikU
                  ulrik @d.healey
                  last edited by

                  @d-healey thanks David!

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

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

                    Just ran into this myself opening an old project.

                    I have a label. When the user types into the label I want to perform an action based on the text that is typed. If I use setConsumedKeyPresses("all"); then the callback triggers but the text in the label doesn't change as the user types. Is this a bug or am I using it incorrectly?

                    HiseSnippet 753.3ocsUstSaCCE1tzvnciogzd.h3WEIDpciwlzDZL5koJnPzJCs+gbSbZ7picjsCP0Duy6MX63jTZKTwkJsnpJeNemujubtEOkzmp0REBW4rwITD9UN8GKLQMiHLApaKD90N8HZCU4l65vwIDslFfv3U9l0AtRYT10e9xgDNQ3Sm5BgNWx7oGyhYlod8N3HFm2gDPOiEOSz6dPWeonojKSA8rhScTBweDYH8DhMrRNH7psCXFopugXnZHlCkAi6GIuRjG+4LMa.mZMZf5C2nb2nlQLdf2j2UMBgK6M8Mek72725ziEvt0+zLvax.bmxX1b.tzCIoFOCIgmQRkykzFN88UrDyTDqddoSWATPBIPpdVojGKpzwXmlRHBgYmXxHZGEXbKiZ6Uu91tvea84pUgzs13dIQ4dLY.k2vce2ILGRMMkwIRAXTayb3MsbxOti1hKzowzfini8Tf7n5ZaR376D0Dzl.z.ndVKLU3aXRQM4fesU0eWs5M.gINckhSjF5ohZVnJUuop6cgBCWHlU3JImSUKD11podHh0DowCnpsgzAOkdafPsX9B7pOsBreddbl.khtBl4zDZgcGIOvV3rmue6.pnP.m9Q2VDCw1gT3ChKgpLLqbvsnWBiX48KUbZQ0iLxjrXKpdH7KLYnqWzMkUaPL3QulSdcBcMB6fOBdVisG1GNbEKvDYM1FiPQT1vHi0xCfLzqM16lNHr3WHLTeulWXrQFjxIl4mkrKMJ.f7+bMv1lTglYFO6Rkmw.V8Gb.6oJwMb7XF+nEqwRKPiPk4+gFKVKstS6vPpuYp.K6z4mK6NnG4w+cYpgIF1iXTLaOwIow8gsw9T3oKDTt11CTx1claW2Zay.8ohfLi+BWEfMr13BvFS.QwDek7B+7oN6hu0x7.ZRjsmuB7AGv1sAJaRb17bLrG9Be+4uU2i36VVhueYIt6xR7CKKw8VVhebYI9oGmn8yjeM0HiyGaPnddsyVcgwsEDnCLqaE8OvbAXk9
                    

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

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      aaronventure @d.healey
                      last edited by aaronventure

                      @d-healey I opened your snippet and can type into the label. Click on label, type, works as expected.

                      macOS 14.4.1 9d0b36cc0e5c4dc9d5c5bc3f434323322fa13fe1

                      d.healeyD 2 Replies Last reply Reply Quote 1
                      • d.healeyD
                        d.healey @aaronventure
                        last edited by

                        @aaronventure Time to fire up my Mac and see if it works there

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

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

                          @aaronventure said in Return the old Content.setKeyPressCallback functionality (that we had for a few days):

                          @d-healey I opened your snippet and can type into the label. Click on label, type, works as expected.

                          macOS 14.4.1 9d0b36cc0e5c4dc9d5c5bc3f434323322fa13fe1

                          Confirmed. Seems to be a Linux bug. I'll see if I can figure it out.

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

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

                            hmmm I can't see anything obvious and no errors reported in the debugger. @Christoph-Hart Any ideas?

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

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

                              @Christoph-Hart If I remove the return true from here it works - https://github.com/christophhart/HISE/commit/65ef5cbdb6b6a28210afd961fa8ebbf7e6a9f7e0#diff-0d582ddb8fc1bed436b29e85947f1c794dabe03de8eba02b4632e41563e4187dR1609

                              But I'm guessing I shouldn't do that?

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

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

                                @Christoph-Hart Bump bump

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

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

                                  @Christoph-Hart Still having this issue on Linux

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

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

                                    @Christoph-Hart Seems this isn't just a Linux problem. Try this snippet on Windows

                                    HiseSnippet 768.3ocsU01SaCCD1tsAQ6FSCo84oH9TQBgZ2XuHglVG8koJnP0JC08IjahaiGN1QIN.USHsex6e.6bbZS5nCXUZ4CU4tm6re5cO2k9gRGZTjLDgKe5z.JB+TqASEJuldDl.0sEB+LqdjHEMz135foAjnHpKBiK9YsCb4Rnjme8wCHbhvgl4BgNSxbnGw7YpLu8abHiy6Pbomx7yE8dM55HEMkbYLvmhV0PADmKHSnGSzgUvBgWqsKSICGnHJZDBW5.o6zAdxqDl3OiEwFwoZi5nAvAYb2Qxc0LV6E0ziwc6O6+cDBNk9YUghlpvKr5wbYy8mUMddBfcVF4qG3BKRuhKPu5+M5sDJgyQoRFJso0.mPVfJCQymmX0U.MmwDnrmmJlXQE5fsZJgHDpc8IWP6DBFyyn5aqUaGa3ms2uREnzGorOhLhxqa+A6YYMgpZJ8CjBvn5VF3sf3MusajFVDE6ScOjNseHvLZT0sHbtNnbQMCsI.MBZqUGGKbTLonpbz22txOpT4ls2elOao3XohdhnpFobkapX+mPiGuTLMsCkbNMbovZAW38kXUQr+HZ3N1WR3wz4ABcgEasq83ZsNlpXt.khtBl5j.Zp88qMQosA3su1sEQQzZiTePbAzPESSGbK5kvflQoT1pEM5BkLHI1zdGButJAciTcTRqAwfqdcKSaBcc1r32ZLctwOOqwULWkGBagCwHjGkMwSosdIfpnWqRFNGMY1na40FNb3slY86nigIHoaLmnVbrRuKIE.ZHKnk05UQDSMM+tl+gYsZ26r1ikhaZ0mob7VNGKrDNBsp+GbLcC0FVsGOl5nxHXIqNCW00QOv0+EYrhIlzinBYfHw53X+APm1gB2tPP4QZwPAsb0XWSaqq.CnB2DiagmTv5ZabJX8YfHehSn7bGyXndG35Id.NIRV+WF9NDXaWGkLZluN6CqjO2wYwi5NI9pUMwWupIt2pl3aV0De6pl36V0De+Cmn9KleJVI8MiMHTu9sS1kgwsEDPAlnVQ+Ff5Dq0.
                                    

                                    I see the relevant HISE source code has changed since I initially reported this issue, so possibly the changes have made it broken for other OSs now :)

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

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

                                      Can someone try the snippet above and confirm the issue? Thanks.

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

                                      A ulrikU CasmatC 3 Replies Last reply Reply Quote 0
                                      • A
                                        aaronventure @d.healey
                                        last edited by

                                        @d-healey Can you please sum up what am I supposed to be looking for?

                                        The snippet behaves like the last one on macOS.

                                        I'm seeing something else, though: if the script callback exists, then pressing enter will not defocus the label i.e. it won't return to its passive/not-editing state, but the Enter/Return callback trigger will definitely go through and send the appropriate obj in the callback.

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

                                          @aaronventure said in Return the old Content.setKeyPressCallback functionality (that we had for a few days):

                                          Can you please sum up what am I supposed to be looking for?

                                          Typing in the box doesn't do anything.

                                          I just tested on MacOS and it's working fine there, so the issue seems to only be on Windows and Linux.

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

                                          ulrikU 1 Reply Last reply Reply Quote 0
                                          • ulrikU
                                            ulrik @d.healey
                                            last edited by

                                            @d-healey this is not working here on MacOS
                                            the label callback fires only if clicking outside the label

                                            Typing works but return, esc and backspace doesn't do anything.

                                            I'm on commit

                                            Skärmavbild 2024-08-17 kl. 19.47.13.png

                                            Hise Develop branch
                                            MacOs 15.3.1, Xcode 16.2
                                            http://musikboden.se

                                            d.healeyD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            22

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.6k

                                            Posts