HISE Logo Forum
    • Categories
    • Register
    • Login

    Turn off keyboard MIDI input for Keyboard Component

    Scheduled Pinned Locked Moved General Questions
    5 Posts 2 Posters 408 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.
    • Casey KolbC
      Casey Kolb
      last edited by

      I'm sure there's an easy way to do this, but how do we avoid MIDI input coming from the computer keyboard keys for the interface Keyboard Component?

      Casey Kolb
      Founder & CEO of Lunacy Audio
      Composer | Producer | Software Developer

      1 Reply Last reply Reply Quote 0
      • jadgJ
        jadg
        last edited by jadg

        When keyboard (floatingTIle keyboard) lost focus , computer keyboard incoming messages don´t affect to it . So if you grabFocus in any another component floatingTIle keyboard don´t recevive the computer keyboard pulse.
        use the grabFocus() function every time you need keyboard don,t receive computer keyboard key event

        function onNoteOn()
        {
        anyComponent.grabFocus();
        }

        function onNoteOff()
        {
        anyComponent.grabFocus();
        }

        This make floatingTile keyboard only receives mouse pulsations !!!

        1 Reply Last reply Reply Quote 0
        • jadgJ
          jadg
          last edited by jadg

          Better option is add to interface a new empty label with textColour and bgColour properties set to a totally transparent colour and "editable" property set to "enabled" in order to receive focus without any perceptible change. In this way;

          OnInit
          {
          const var Label1= Content.getComponent(("Label1");
          //(change colours and editable properties in editor)
          /./ any code...
          }

          function onNoteOn()
          {
          Label1.grabFocus();
          /./ any code...
          {

          function onNoteOff()
          {
          Label1.grabFocus();
          /./ any code...
          {

          AnyWay , can you explain why do you need that ?

          Casey KolbC 1 Reply Last reply Reply Quote 0
          • Casey KolbC
            Casey Kolb @jadg
            last edited by Casey Kolb

            @jadg That's a bit hacky I'm afraid. We'll need a way to completely ignore incoming key strokes for that component without having to constantly change focus.

            There are other serious implications with the method you suggest too. Imagine wanting to have focus on your preset browser so users can switch presets with their arrow keys, but every time they play a note it loses focus on the browser.

            Casey Kolb
            Founder & CEO of Lunacy Audio
            Composer | Producer | Software Developer

            1 Reply Last reply Reply Quote 0
            • jadgJ
              jadg
              last edited by

              It,s really a bit hacky as you say...:beaming_face_with_smiling_eyes:

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

              37

              Online

              1.7k

              Users

              11.7k

              Topics

              102.0k

              Posts