PC Remote Control FAQ
=====================
http://www.pcremotecontrol.com
by Moises Cambra, mcambra@pcremotecontrol.com

Last update: 25 Oct 2001


I sort of get it but a few more clues would be very helpful
-----------------------------------------------------------
Basically you have remote control commands, usually from TV remotes.
When you press a remote button and with the help of an infrared
receiver, the stream is converted into meaningful data for the
computer. PCRC stores that sequence during the learning process and
since then, every incoming sequence is compared with the list of
learned commands. When a previously learned sequence is detected, the
action settled for that command is executed.

In previous versions of PCRC, every command had its own associated
action, meaning that your remote button always did the same thing on
the computer. From version 4, the same command can trigger different
actions depending on the active application. When you define a layout,
you are creating a list of actions that will be executed ONLY when the
foreground application is the same you especified in the layout. For
example, it means that the 'Play' button of your remote can do
different things if the active application you want to control is
Winamp or the Media Player.

The other big improvement of version 4 is the fact that for triggering
an action you can combine several commands. This way, you can multiply
the available actions with the same number of remote buttons. For
example, you could define an action to happen after receiving buttons
1 and 2, and another different one after receiving 2 and 1. You could
also trigger the same action with button 1 or 2 selecting OR
triggering.
The Layouts_demo.pcr file, demonstrates how the same three commands do
different things depending on the active application, and it will let
you get the idea of how to configure the commands and actions.

Every layout is just a group of actions that only happen when the
foreground window has the same title or classname as the one
especified in the layout settings. In your case, you could have a
Winamp layout, a DVD player layout, etc. For example, you want that
the 'Play' button of your remote makes Winamp to start playing and the
same for the DVD player. To do this, you just need to define for every
layout the action that makes the program start playing, and link that
action with the command 'Play' of your remote. When this happens, and
you press 'Play', PCRC will check if the active application is in the
layouts list. In such case, the action executed will be the one you
especified for that application.


How do I associate a set of commands to one application only?
-------------------------------------------------------------
Create a layout (Actions | Layouts setup... or press the button next
to the actual layout combobox). If the application is running, you can
easily find it on the tree list 'Running applications'. If not, add a
new one and be sure you write a 'Window title' that fits partial or
completely with the application you want to control. It searchs what
you write in the window title, meaning that you can write only the
fixed part of the title and PCRC will find it anyways. For example, '-
Notepad'. All the actions that you add to that layout will be
simulated when Notepad is the active window.


Can you describe the different fields in the recognition panel?
---------------------------------------------------------------
An example from two different buttons, sending two sequences:

Button1
14 20 30 80 00 00 AA
88 20 31 80 00 00 00 00 00 AA

Button2
33 30 20 80 00 AA
17 29 20 81 00 AA

'Skip first': The first value from some receivers is random. In our
example, skip first would skip the first value in the comparison.
'Tolerance': If values 30 and 31 are supposed to be the same, a
tolerance of 1 would tell the program to consider them the same.
'Length limited': We suppose this remote sends a 'head', some
repetitive values while you leave pressed the button and a tail when
you release it. The comparison ends at the length of the shorter one,
so in this case, instead of setting a tolerance value too big that
could result in wrong recognitions, we limit the comparison to 5 if we
know that the ending value never arrives sooner than that.
'Number of bytes': For serial port devices that send several bytes for
a single value.
'Equal sequences have the same length': Useful for buttons that send
two codes, one for pressing and another one for releasing (down-up).
When this option is enabled, you can distinguish between both
situations.
'Consider binary values': Some receivers send sequences whose values
are very close to each other, making the tolerance setting unuseful.
With this option, all values fall into two groups, over or below
certain level.


Is there an easy method of debugging the settings commands for
recognition of the remote keys? I get a lot of duplicate hits from
the remote.
------------------------------------------------------------------
While the PCRC window is visible, and you have your origin opened, you
can send the commands and if they are recognized correctly, the one
you send becomes highlighted with a red ball. Or you can enable the
OSD function, checking on the 'Name of the command'. If you refer to
debugging at a lower level, use the 'Test origin' window to see what
kind of data you are receiving.


Is it possible to use the built in infrared port on my laptop to
recieve TV remote control signals? Using the virtual COM port?
----------------------------------------------------------------
The picture is kind of black. Windows takes control over the physical
serial port where the IrDA module is connected and makes it appear as
a network device. No other software can then access the serial port.
In W98 there was a way to cheat Windows and leave the device as a
serial port thing (http://www.pcremotecontrol.com/irda.html), but in
ME and 2000, for the moment there is not known way. PCRC would need to
get the data coming from the IrDA hardware directly.
Additionally, there is no way to assure a good reliability since IrDA
hardware is not really prepared for TV remote controlling.

It is a common mistake to think that the virtual serial port is going
to receive data from an infrared remote. The infrared virtual port is
just a software layer over IrDA, and it is only intended to connect to
another IrDA device that is using the same protocol, etc.
