Forum

    • Register
    • Login
    • Search
    • Categories

    KeyPressCallback

    General Questions
    2
    8
    159
    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.
    • ulrik
      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 13, Xcode 14.0.1
      http://musikboden.se

      ulrik 1 Reply Last reply Reply Quote 0
      • ulrik
        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 13, Xcode 14.0.1
        http://musikboden.se

        d.healey 1 Reply Last reply Reply Quote 0
        • d.healey
          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

          ulrik 1 Reply Last reply Reply Quote 1
          • ulrik
            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 13, Xcode 14.0.1
            http://musikboden.se

            1 Reply Last reply Reply Quote 0
            • d.healey
              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

              ulrik 1 Reply Last reply Reply Quote 0
              • ulrik
                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 13, Xcode 14.0.1
                http://musikboden.se

                d.healey 1 Reply Last reply Reply Quote 1
                • d.healey
                  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

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

                    @d-healey agreed!

                    Hise Develop branch
                    MacOs 13, Xcode 14.0.1
                    http://musikboden.se

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

                    9
                    Online

                    983
                    Users

                    6.6k
                    Topics

                    60.8k
                    Posts