Home AMX User Forum NetLinx Studio

Mio Classic Keypads & Hold

I was working on getting the hold for the volume up & volume down ramp on the new Mio Classic keypads with no luck.

I programmed it like you would the old 8 button keypads but as I hold the button down I get nothing any ideas?

example:
BUTTON_EVENT[dvKeypads,nKeypad_Buttons]
{
    PUSH:
    {
	nPanel_Index = Get_Last(dvKeypads) + 5
	nPanel_Address = nPanel_Index + 144
	nButton = Get_Last(nKeypad_Buttons)
	Switch(nButton)
	{
	    CASE 6:	/// Volume Up
	    {
		/// command to send volume up
		BREAK
	    }
	    CASE 7:	/// Volume Down
	    {
		/// command to send volume down
		BREAK
	    }
	}
    }
    HOLD[2,Repeat]:
    {
	Switch(nButton)
	{
	    CASE 6:	/// Volume Up
	    {
		/// command to send volume up
		BREAK
	    }
	    CASE 7:	/// Volume Down
	    {
		/// command to send volume down
		BREAK
	    }
	}
    }
}

using an ada suite 16 switcher

Comments

  • Spire_JeffSpire_Jeff Posts: 1,917
    Not sure that this applies, but if you are trying to accomplish this in a module, it will only see the HOLD events on the first instance of the module. The only fix I am aware of at this time is to save the module with multiple names (one for each instance).

    Jeff
  • Do you see a release, and if so when?

    You could set a flag value between push and release and use a 2/10 sec timeline to do the hold programmatically.
  • ondrovicondrovic Posts: 217
    Thanks for the replies I will give your suggestions a shot and see where it leads me.
  • GSLogicGSLogic Posts: 562
    ondrovic wrote:
    I was working on getting the hold for the volume up & volume down ramp on the new Mio Classic keypads with no luck.
    You want to trigger the PUSH action on the RELEASE, unless you HOLD the button.
    Add the variable nPushOnly above:
    BUTTON_EVENT[dvKeypads,nKeypad_Buttons]
    {
      PUSH:
      {
    	nPanel_Index = Get_Last(dvKeypads) + 5
    	nPanel_Address = nPanel_Index + 144
    	nButton = Get_Last(nKeypad_Buttons)
      }
      HOLD[2,Repeat]:
      {
    	nPushOnly = 1;
    	Switch(nButton)
    	{
    	  CASE 6:	/// Volume Up
    	  {
    		/// command to send volume up
    	  }
    	  CASE 7:	/// Volume Down
    	  {
    		/// command to send volume down
    	  }
    	}
      }
      RELEASE
      {
    	if(nPushOnly == 0)
    	{
    	  Switch(nButton)
    	  {
    		CASE 6:	/// Volume Up
    		{
    		/// command to send volume up
    		}
    		CASE 7:	/// Volume Down
    		{
    		/// command to send volume down
    	  }
    	}
    	else
    	{
    	  nPushOnly = 0;
    	}
      }
    }
    
  • ondrovicondrovic Posts: 217
    Thanks GSLogic I will give that a try
  • ondrovicondrovic Posts: 217
    Just wanted to report back and say thanks. GSLogic what you proposed worked great thanks for the help.
Sign In or Register to comment.