View Full Version : Press button, one action, HOLD button another action?

Vinny Singh
January 4th, 2006, 07:41 PM
I'm short 2 buttons on the single remote I want to use.

Is there a way a button, when pressed for a single event (short click), does something, and the same button HELD DOWN for like 2 seconds does something else?

My original CRT remote had a toggle power button like this. If you held it down, it would power up or down depending on state. If you tapped it, it would blank the screen.

I'm just using "RAW: Generic X10 Remotes" mappings right now. In the Event window for a certain button, what exactly is the modifier? What is Anti Repeat (I assume it keeps that button from repeating for specified # of ms).

Down, Repeat, or Up, and they can be all or none checked.


January 5th, 2006, 12:35 AM
I used an example by t-bear to accomplish this: http://www.promixis.com/phpBB2/viewtopic.php?t=12312

I'm also attaching a snippet from my GML for MyHD that uses the FFWD button on my remote to perform three functions: press-release(FFwd 1x), press-hold-release (FFwd 4x) and press-hold longer than 1.3 secs (repeat FFwd 1x).

There is probably a more elegant way to do this, but it works great for me!


Vinny Singh
January 5th, 2006, 04:35 PM
Awesome! I think I can figure it out using my devices and my actions. Thanks again!

(is there another way to do this as well, since my remote does register down, repeat and up events?)

January 6th, 2006, 05:05 AM
Yes, it should be rather easy. Just copy the event string (where you have learnt the code) to the command you want run on repeat, and remove the tick for down, while ticking off for repeat. That should do it, I think.

Vinny Singh
January 6th, 2006, 10:32 AM
I ended up using the code almost verbatim (minus the variable names and event names). Now one ATI remote wonder I (generic x10) big red power button actually has FIVE functions!

If Windows Media center doesn't exist, tap it, and it starts it up for you. It also sends a standby (blank CRT w/o actually powering down) on or off signal (based on state settings, there are TWO states possible, and it flip flops between them.

HOLD it for more than 1.5 seconds or so, and it powers up the projector. If you keep holding, it will also turn it OFF after about 5 seconds. If you KEEP holding the button, it will again turn on after 10... This can be bad for your equipement... so avoid trying this too much.. This is also a flip flop toggle. You don't have to hold it for 5 seconds to turn off, just a safety feature. Release the button and try again, and you can always change the state within 1.5 seconds.

My problem was, If I sent a POWER ON command while it was already on or in the middle of powering up..., it would mess up the serial communication for some reason. I would have to unplug power to reset it. This way, you can (almost) never accidentally get two "ON" events in a row, because the device can react fast enough to turn on and off within 5 seconds.

Media center does not shut down with this or any other button, you have to use the remotes' mouse to actually force it to close. This is a dedicated HTPC, I don't want people messing around in the OS and trying to play their stuff in some of the other apps.

This is fun! My first GML is attached below. Thanks for the help again!