| 1 |
root |
1.1 |
NAME |
| 2 |
|
|
RCU - Remote Control Unit Interface |
| 3 |
|
|
|
| 4 |
|
|
SYNOPSIS |
| 5 |
|
|
use RCU; |
| 6 |
|
|
|
| 7 |
|
|
DESCRIPTION |
| 8 |
|
|
This module provides a generic interface to remote control units (only |
| 9 |
|
|
receivers at the moment, as I cannot test more). It only provides an |
| 10 |
|
|
abstract management interface, other modules are required for the |
| 11 |
|
|
hardware access (RCU::Irman and RCU::Lirc are included, however). |
| 12 |
|
|
|
| 13 |
|
|
GETTING STARTED |
| 14 |
|
|
Please read RCU::Receipts to get some idea on how to proceed after you |
| 15 |
|
|
installed the module (testing & standard techniques). |
| 16 |
|
|
|
| 17 |
|
|
THE RCU CLASS |
| 18 |
|
|
The RCU class provides a general interface to anything you might want to |
| 19 |
|
|
do to, it represents your application. |
| 20 |
|
|
|
| 21 |
|
|
$rcu = new RCU "interface-spec" |
| 22 |
|
|
Creates a new RCU application. "interface" must be an interface |
| 23 |
|
|
specification similar to DBI's DSN: |
| 24 |
|
|
|
| 25 |
|
|
RCU:ifname:arg:arg... |
| 26 |
|
|
|
| 27 |
|
|
Examples: low-level interface (without "RCU::" prefix) or an |
| 28 |
|
|
arrayref containing name and constructor arguments. If the interface |
| 29 |
|
|
name has a "::" prefix it will be used as-is (without that prefix, |
| 30 |
|
|
of course). |
| 31 |
|
|
|
| 32 |
|
|
For a much better interface, see RCU::Event. |
| 33 |
|
|
|
| 34 |
|
|
$rcu->interface |
| 35 |
|
|
Return the RCU::Interface object used by this RCU object. |
| 36 |
|
|
|
| 37 |
|
|
($keycode, $repeat) = $rcu->get |
| 38 |
|
|
($keycode, $repeat) = $rcu->poll |
| 39 |
|
|
Simplified interface to the RCU (See also RCU::Event), return a |
| 40 |
|
|
cooked keycode and a repeat count (initial keypress = 0, increasing |
| 41 |
|
|
while the key is pressed). If "get" is called in scalar context it |
| 42 |
|
|
only returns unrepeated keycodes. |
| 43 |
|
|
|
| 44 |
|
|
This interface is problematic: no key-up events are generated, and |
| 45 |
|
|
the repeat events occur pseudo-randomly and have no time relation |
| 46 |
|
|
between each other, so better use the event-based interface provided |
| 47 |
|
|
by RCU::Event. |
| 48 |
|
|
|
| 49 |
|
|
THE RCU::Key CLASS |
| 50 |
|
|
This class collects information about rcu keys. |
| 51 |
|
|
|
| 52 |
|
|
THE RCU::Interface CLASS |
| 53 |
|
|
"RCU::Interface" provides the base class for all rcu interfaces, it is |
| 54 |
|
|
rarely used directly. |
| 55 |
|
|
|
| 56 |
|
|
fd Return a unix filehandle that can be polled, or -1 if this is not |
| 57 |
|
|
possible. |
| 58 |
|
|
|
| 59 |
|
|
($time, $raw, $cooked) = $if->get |
| 60 |
|
|
($time, $raw, $cooked) = $if->poll |
| 61 |
|
|
Wait until a RCU event happens and return it. If the device can |
| 62 |
|
|
translate raw keys events (e.g. hex key codes) into meaningful names |
| 63 |
|
|
("cooked" keys) it will return the cooked name as second value, |
| 64 |
|
|
otherwise both return values are identical. |
| 65 |
|
|
|
| 66 |
|
|
"get" always returns an event, waiting if neccessary, while "poll" |
| 67 |
|
|
only checks for an event: If one is pending it is returned, |
| 68 |
|
|
otherwise "poll" returns nothing. |
| 69 |
|
|
|
| 70 |
|
|
SEE ALSO |
| 71 |
|
|
RCU::Irman, RCU::Lirc. |
| 72 |
|
|
|
| 73 |
|
|
AUTHOR |
| 74 |
|
|
This perl extension was written by Marc Lehmann <schmorp@schmorp.de>. |
| 75 |
|
|
|
| 76 |
|
|
BUGS |
| 77 |
|
|
No send interface. |
| 78 |
|
|
|