Jump to content
c4forums | The Control4 Community

Multiple button combos --> programming. (New to me; old news to pros/informed.)


Recommended Posts

Just wanted to share a quick tip for others that may be new to C4 like me. I was surprised there wasn't a native ability to attach commands to multiple button combinations (or any input really); therefore, I wanted to share my solution: variables.

For example, I programmed a quick press of 'down then up' on my (Control4 keypad's) volume buttons to turn rooms off. I'd initially tried double/triple press, but that overlapped with normal behavior. Example below -- enjoy!

(And kudos to whoever has the best combo already going. Contemplating where/how to use the Konami code myself, ha.)

 

Screenshot 2021-01-01 024546.jpg

Screenshot 2021-01-01 024627.jpg

Screenshot 2021-01-01 024701.jpg

Link to post
Share on other sites

On 1/1/2021 at 9:35 AM, TundraSonic said:

Good stuff!  Yeah, I've been frustrated by the lack of some built-in stuff, especially long presses and dual presses. Dual press would seem ideal for your application.

Thanks! Good point on dual press -- I think I'm going to try that next/instead. Unless there's some limitation on simultaneous commands, I could just switch the variable to only be active on press/deactivate on release and that should do it. It'd also seem possible to do long press by setting a delay/timer within the variable, but that may be clunky in real life.

Link to post
Share on other sites
22 hours ago, lippavisual said:

I don’t see the logic in doing this.  What are you trying to do and why?

I want a way to turn off (media in) rooms from a six button keypad that isn't easily accidentally triggered or intermingled with other commands (or even illogical labels). For example, if I made it a triple press of the 'down' button, I could inadvertently trigger it through normal behavior. My lighting buttons use connections, so there'd be no way to separate it from those commands. Having this combo action solves that (and is a fairly common UI element IMO). 

Link to post
Share on other sites
1 hour ago, booch said:

Thanks! Good point on dual press -- I think I'm going to try that next/instead. Unless there's some limitation on simultaneous commands, I could just switch the variable to only be active on press/deactivate on release and that should do it. It'd also seem possible to do long press by setting a delay/timer within the variable, but that may be clunky in real life.

Circling back to confirm this worked. I actually implemented press-and-hold as well. So now:

Press either volume button once = pulse volume

Press either and keep holding = continue pulsing volume every 250ms (could also be used for long press)

Press both simultaneously = turn room off

Link to post
Share on other sites

I assume you realize you can program off of a single tap, double tap and triple tap of any button? But the trick is, when using the single, double and/or triple taps, you do not want to have any bindings on that button and you should not program against the “press” command.

Link to post
Share on other sites
  • 2 weeks later...
On 1/3/2021 at 6:57 AM, C4 User said:

I assume you realize you can program off of a single tap, double tap and triple tap of any button? But the trick is, when using the single, double and/or triple taps, you do not want to have any bindings on that button and you should not program against the “press” command.

Thanks. I do get this. I was referring to gaining the other UI combos/controls we've become accustomed to with our phones and rich web. My wife is loving the 'double volume off,' for example.

Sorry if this seems nitpicky/dense, btw. I'm a product exec., so passion over this stuff is my job, ha.

Link to post
Share on other sites

Volume would be:

WHEN button up is pressed

Start volume up command to room x

WHEN button up is released

Stop volume up to room x

This accomplished a direct tap AND hold function with more accuracy.

 

Can still program on both buttons:

WHEN button up is pressed, IF button down is pressed turn off room

and reverse for the other button so that pressing on or the other first doesn't matter.

Link to post
Share on other sites

Makes sense, but how do you do a volume up 'start'?

Wanted to do a loop, but this was all I could do in HE (below). Works great, but would love to clean up the code for pride sake!

Up.PNG

Link to post
Share on other sites

Same for the power off - if you really want that on a press both, you'd still literally go

 

WHEN button UP is pressed
IF button DOWN is pressed
	turn of room

Do the same on the DOWN button, and regardless which of the two was pressed first it'll shut off the room.

 

No need for variables, else statements and so on and so forth.

Link to post
Share on other sites
9 hours ago, Cyknight said:

And yes, do both lines of programming under 'pressed' and it'll work (doesn't matter if it sends volume commands as well, the room is off anyway)

These are great tips -- thank you!

Link to post
Share on other sites
13 hours ago, Cyknight said:

Same for the power off - if you really want that on a press both, you'd still literally go

 


WHEN button UP is pressed
IF button DOWN is pressed
	turn of room

Do the same on the DOWN button, and regardless which of the two was pressed first it'll shut off the room.

 

No need for variables, else statements and so on and so forth.

Wow -- just updated my stuff -- you weren't kidding with the 'overthinking'! Thanks again.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...