HISE Logo Forum
    • Categories
    • Register
    • Login

    KeyPressCallback

    Scheduled Pinned Locked Moved General Questions
    8 Posts 2 Posters 392 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
      last edited by ulrik

      When I have a panel with a paint routine, mouse callback and a keypress callback assigned to the object, the paint routine and the mouse callback is visible as methods to the object but not the key press callback, is this intentional or is this a bug?

      And is it possible to treat this 3 callbacks as methods for the object?

      keypress.gif

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

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

        @ulrik What I'm trying to do is to set focus to an object from another object, and that works nicely if I just set "this" referencing to another object like this:

        const PBRenameKPC = (function(obj) 
        {
        	var idx = Math.floor(AddDelRenamePnls.indexOf(this)/3);
        	
        	this = PBNamePnls[idx];
        	
        	if(obj.isFocusChange)
        		this.data.hasFocus = obj.hasFocus;
        			
        	else
        	{
        		switch (obj.keyCode)
        
        etc.....
        

        but I also need to use the

        event.result
        

        from an object (that I can't set a keypresscallback on), to set focus on another object.

        Is it possible? Any help is much appreciated.

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

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

          @ulrik

          (function(obj)

          You don't need that ( at the beginning.

          I don't think it's a good idea to reassing this. Use a reg variable outside of the function for that instead.

          set focus to an object from another object

          What do you mean by object in this context?

          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 ulrik

            @d-healey said in KeyPressCallback:

            @ulrik

            (function(obj)

            You don't need that ( at the beginning.

            I don't think it's a good idea to reassing this. Use a reg variable outside of the function for that instead.

            set focus to an object from another object

            What do you mean by object in this context?

            Ok, I didn't know that, thanks :)

            the event.result come from a panel, that has several areas for setting values from 0 => 10 or more when using event.clicked , and I have it setup so that when using event.result I get one value from the hovered area, so event result inside area 4 will give the result of the area name which is also another panels id.

            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

              I think what we have here is an XY problem ;)

              Start from the beginning and tell me what you want without telling me about what you've tried to do to achieve what you want :)

              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 with the event.result from one panel I want to set another panel in focus so it will receive keypresses

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

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

                  @ulrik Ah I see what you're doing. I think what we really need for this is a Content.setFocus(componentId) function or something similar. Everything else will be hacky.

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

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

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

                    23

                    Online

                    1.7k

                    Users

                    11.8k

                    Topics

                    103.2k

                    Posts