View Full Version : How to use the second code on the remote control?
Loll
November 27th, 2003, 12:13 AM
How to use the second code on the remote control when pressing the button a longer time?
Hello
I have recently bought a PC with a remote control (Medion X10-usb). To programm this remote control I have found this nice programm called grider.
Afer installing the programm and the right plugin, it seems to work properly.
The only problem which I have is the correct recognition of the pressingtime of a button, e.g. I see that when I press a button on the remote control, this button has two different transmission codes (depending on the time I press the button).
1.) How can I enter the second code (second code = the code which is transmitted when I press the button for a longer time)? (because, “learning event” recognize one the first code)
(As pedantic alternative I have found the following thin:One press the buttom on the remote control (and holds this is pressed, thus the appropriate code sent) and selects then with the mouse the "event to learn" an the SOMETIMES the programm enter the right Code). Is there a more easier way to enter such a “secondary” code.
2.) Now one could believe that with that one could doubly the keynumbers. But I have a little logical problem. When I will press a key, so the first code (an command) will be executed. But how could I reach the second command (see 1.) ) on the same key without activating the first command?
Thanks
Loll
Bitmonster
November 27th, 2003, 04:56 AM
The medion remote should be compatible with the ATI Remote Wonder (at least for most keys). You can download this file (http://www.bitmonster.com/girder/bitmonster.zip) and use the "ATI Remote Wonder Keys.GML" as a template for your events.
Also I suggest you should install the logger plugin, as it helps to understand the events your remote sends.
The answer to your second question is simple: You can't.
The remote first sends one "Down" event, then repeatedly "Repeat" events and if you release the button a single "Up" event. This is used to have a chance to fire a command only once if you assign it to the "Down" event or repeatedly if you assign it to the "Repeat" event.
Loll
December 2nd, 2003, 12:01 AM
If each key sends 3 instructions (Down, Repeat, Up), is it not possible
to determine the the time between the Down-instruction and the Up-instruction
I think, if at all, then it is with the Lua-Script realiseable. But how will look such a script look like?
The idea behind it is the following: If this Time Determination would be possible, then one could use these keys for several funktions.
Salutations
Bitmonster
December 2nd, 2003, 03:12 AM
Yes, this is possible and I use it all the time. I have a set of functions to handle even more, but for this special case only you can use something like this for every down-event:
lastDownTime = GetTickCount()
and then for the up-event:
local timediff = GetTickCount() - (lastDownTime or 0)
if timediff < 100 then -- if button press time was shorter than 100 ms
TriggerEvent("event1", 18) -- fire event1
elseif timediff < 1000 then -- if button press time was shorter than 1000 ms
TriggerEvent("event2", 18) -- fire event2
elseif timediff < 2000 then -- if button press time was shorter than 2000 ms
TriggerEvent("event3", 18) -- fire event3
else -- if button press time was longer than 2000 ms
TriggerEvent("event4", 18) -- fire event4
end
This will fire different "girder events" dependant of the time between the button down- and up-event.
miked
December 2nd, 2003, 11:12 AM
To learn the code that the remote control sends out after the button has been pressed a while, first press and hold the button until the "hold" code is being emitted, and *then* press the learn button on Girder. Girder will take in the first IR code it finds, and because the "second" IR code is currently being emitted from the remote, Girder will lock onto that.
Loll
December 2nd, 2003, 11:04 PM
@ miked
I know this already, but as I has allready written in my first entry there is a little problem with this procedure:
2.) Now one could believe that with that one could doubly the keynumbers. But I have a little logical problem. When I will press a key, so the first code (an command) will be executed. But how could I reach the second command (see 1.) ) on the same key without activating the first command?
Bitmonster with hindsight logical answer was:
The answer to your second question is simple: You can't.
The remote first sends one "Down" event, then repeatedly "Repeat" events and if you release the button a single "Up" event. This is used to have a chance to fire a command only once if you assign it to the "Down" event or repeatedly if you assign it to the "Repeat" event.
But my Idea is that one could utilize the UP and Down Commands.
(I think this is not possible for an IR remote controle - but I have radio controlled one.)
@Bitmonster:
Thanks, I will try this as soon as possible.
Does this If-command not have only to be executed when an Up-Command has been catched by girder.
Where I will get the spezial Girder-Lua-script-commands like "GetTickCount"??
Salutation
Bitmonster
December 3rd, 2003, 03:46 AM
Does this If-command not have only to be executed when an Up-Command has been catched by girder.Yes. As I said, the first script has to be assigned to the down-event and the second script to the up-event (and none to the repeat event).
Where I will get the spezial Girder-Lua-script-commands like "GetTickCount"??It's build into Girder's LUA as an extension (see the online help). Every "Variable Manipulation Script" has access to these functions.
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.