Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-testing > by-pkgid > 69ad6d1b8ee1e33fb9804f7479b72e2f > files > 41

lirc-0.8.2-1.20080310.2.2mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
  <HEAD>
    <TITLE>LIRC - Linux Infrared Remote Control</TITLE>
    <LINK REL=stylesheet TYPE="text/css" HREF="../lirc.css">
    <LINK REL="shortcut icon" HREF="../favicon.ico">
    <META NAME="description" CONTENT="LIRC - Linux Infra-red Remote Control">
    <META NAME="keywords" CONTENT="linux, kernel module, remote control, animax, multimedia">
  </HEAD>
  
  <BODY BACKGROUND="../images/marb18.jpg"
    BGCOLOR="#FFFFFF" TEXT="#000000" ALINK="#8080FF">
    <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
      <TR>
	<TD CLASS="menu" WIDTH="100%" HEIGHT="150">
	  <IMG SRC="../images/diode.gif" ALT=""
	    WIDTH="300" HEIGHT="150" BORDER="0" HSPACE="20"
	    VSPACE="0" ALIGN="LEFT"> 
	  <IMG SRC="../images/lirc.gif" ALT=""
	    WIDTH="300" HEIGHT="150" BORDER="0" HSPACE="20"
	    VSPACE="0" ALIGN="RIGHT">
	</TD>
      </TR>
      <TR>
	<TD WIDTH="100%">&#160;<BR>
	  <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
	    <TR>
	      <TD WIDTH="15%">&#160;<BR></TD>
	      <TD WIDTH="70%" ALIGN="LEFT" VALIGN="TOP">&#160;<BR>

<!-- Text ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<H1>IRXEVENT</H1>
<HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

irxevent - infrared X-event sender
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>

<B>irxevent</B>

[<I>option</I>]... [<I>config file</I>]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>

Irxevent is a program that I wrote to send button clicks and key presses to X
applications triggered by a LIRC driven remote control. You can control your
favorite CD/MP3 player or your TV tuner program or any other X application
that responds to keyboard or mouse input. If you like to you can send emacs
^X^S from your armchair.
<P>
Irxevent is a complement to irexec and irpty.
<DL COMPACT>
<DT><B>-d</B> <B>--daemon</B><DD>
fork and run in background
<DT><B>-h</B> <B>--help</B><DD>
display usage summary
<DT><B>-V</B> <B>--version</B><DD>
display version
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>FILES</H2>

Irxevent works with the same config file as irexec and irpty (~/.lircrc). For
a complete sample .lircrc look at examples/lircrc.
<P>
<B>Part of your .lircrc could look like this:</B>

<P>
<PRE>
<DL COMPACT><DT><DD>begin
        prog = irxevent
        button = VIDEO_UP    
        config = Key SHIFT-KP_Add CurrentWindow
end
begin
        prog = irxevent
        button = VIDEO_DOWN
        config = Key SHIFT-KP_Subtract CurrentWindow
end
begin
        prog = irxevent
        button = STOP
        config = Key ctrl-c CurrentWindow
end
begin
        prog = irxevent
        button = 0
        config = Key f xawtv
        config = Key f xawtv
end
begin
        prog = irxevent
        button = POWER
        config = Key q xawtv
end
begin
        prog = irxevent
        button = CH_DOWN
        config = Button 1 329 92 kscd
end
begin
        prog = irxevent
        button = UP
        config = Button 1 110 80 GQmpeg
end
begin
        prog = irxevent
        button = DOWN
        config = Button 1 130 80 GQmpeg
end
</DL>
</PRE>

<P>
<B>Simply said </B><I>config</I><B> =  lines may look like this:</B>

<P>
<PRE>
<DL COMPACT><DT><DD>config = Key [shift-][ctrl-][alt-]&lt;key&gt; [Focus] &lt;windowname&gt;
        | WindowID &lt;id&gt; | CurrentWindow | RootWindow
config = Button &lt;button&gt; &lt;x&gt; &lt;y&gt; [Focus] &lt;windowname&gt; | WindowID &lt;id&gt; 
        | CurrentWindow | RootWindow
config = xy_Key &lt;x&gt; &lt;y&gt; [shift-][ctrl-][alt-]&lt;key&gt; [Focus]
        &lt;windowname&gt; | WindowID id | CurrentWindow | RootWindow
</DL>
</PRE>

<P>
<B>some more examples:</B>

<P>
<PRE>
<DL COMPACT><DT><DD>config = Key Up xawtv
config = Key Down xawtv
config = Button 1 50 110 xclickme
config = Key q xawtv
config = Key ctrl-c mpg123
config = Key shift-Page_Up rxvt
</DL>
</PRE>

<P>
<B>In BNF this looks like:</B>

<P>
<DL COMPACT><DT><DD>
<PRE>
LINE    = &quot;config =&quot; &lt;KEY|BUTTON|XYKEY&gt; &lt;TARGET&gt; |
          &quot;config =&quot; &lt;KEY|BUTTON|XYKEY&gt; &quot;Focus&quot; &lt;TARGET&gt;
XYKEY   = &quot;xy_Key&quot; &lt;x_position&gt; &lt;y_position&gt; &lt;MOD&gt;&lt;KEYSPEC&gt;
KEY     = &quot;Key&quot; &lt;MOD&gt;&lt;KEYSPEC&gt;
MOD     = [&quot;shift-&quot;][&quot;numlock-&quot;][&quot;ctrl-&quot;][&quot;alt-&quot;][&quot;meta-&quot;]
          [&quot;numlock-&quot;][&quot;mod3-&quot;][&quot;mod4-&quot;][&quot;scrlock-&quot;]
KEYSPEC = Keyname | &quot;KeySym:&quot;KeySym | &quot;KeyCode:&quot;KeyCode
BUTTON  = &quot;Button&quot; &lt;1..5&gt; &lt;x_position&gt; &lt;y_position&gt;
TARGET  = Windowname | &quot;WindowID&quot; id | &quot;CurrentWindow&quot; | &quot;RootWindow&quot;
</PRE>

<P>
<I>Keyname:</I>

<DL COMPACT><DT><DD>
is the key symbol that is declared in X windows. E.g. &quot;Up&quot; refers to the
cursor arrow pointing up. &quot;KP_Add&quot; is the plus sign on the key pad. Just take
a look at irxevent.keys (in the documentation directory) if you are not sure
about a symbol's name.
</DL>

<I>KeySym:</I>

<DL COMPACT><DT><DD>
number as returned by XStringToKeysym(3x).
</DL>

<I>KeyCode:</I>

<DL COMPACT><DT><DD>
number as returned by XKeysymToKeycode(3x).
</DL>

<I>Windowname:</I>

<DL COMPACT><DT><DD>
can be the first characters of the window name displayed by the window manager
or the name that is displayed below the icon. Some programs use the name
displayed by the window manager to show a lot of status information but don't
change the icon name (like xawtv). Others append information to the window
name (&quot;GQmpeg - kill_windooz.mp3&quot;). If neither window name nor icon name match
the given Windowname information from XClassHint(3x) will be checked.
</DL>

<I>CurrentWindow:</I>

<DL COMPACT><DT><DD>
refers to the active window as returned by XGetInputFocus(3x). Most times this
is the window with your mouse pointer in it.
</DL>

<I>RootWindow:</I>

<DL COMPACT><DT><DD>
refers to the <I>root</I> window as returned by RootWindow(3x). You may need
this to send events to the window manager.
</DL>

<I>WindowID id:</I>

<DL COMPACT><DT><DD>
refers to the window with window identifier <I>id</I>. <I>id</I> should be a
decimal number. It is useful when irxevent can't find the desired window by
other means.
</DL>

<I>Focus:</I>

<DL COMPACT><DT><DD>
will send the specified event to the given window only if it currently has the
input focus. This of course does not make much sense when combined with
CurrentWindow.
</DL>

</DL>

<A NAME="lbAF">&nbsp;</A>
<H2>TROUBLESHOOTING</H2>

<P>
If you have problems finding the coordinates for a button click you can try
xev -id &lt;window_id&gt;. The window_id can be found using xwininfo. If xev and
xwininfo are not part of your distribution you can find them at a FTP server
using the search engine at: <A HREF="http://ftpsearch.ntnu.no/">http://ftpsearch.ntnu.no/</A> . xev also reports the
names of key symbols like &quot;Control_L&quot; (your left control key) or &quot;KP_Subtract&quot;
(the 'minus' key on your keypad).
<P>
There are programs that do not accept any synthetic X-events by default
because they can cause security problems. Currently xterm and xemacs are known
to ignore events simulated by irxevent.
<P>
You can however make xterm accept external events by enabling &quot;Allow
SendEvents&quot; in the &quot;Main Options&quot; (hold down the Ctrl button and press the
left mouse button inside the xterm window). You can as well place this line
into your .Xresources file to change this permanently:
<P>
<DL COMPACT><DT><DD>
XTerm.vt100.allowSendEvents: true
</DL>

<P>
Yet another possibility is to start xterm like this:
<P>
<DL COMPACT><DT><DD>
xterm -xrm &quot;XTerm.vt100.allowSendEvents: true&quot;
</DL>

<P>
xemacs will accept events if you set a built-in variable. The following was
taken from the online help:
<P>
<DL COMPACT><DT><DD>
`x-allow-sendevents' is a built-in boolean variable.
<P>
Value: t
<P>
Documentation:
<P>
*Non-nil means to allow synthetic events.  Nil means they are ignored.
<P>
Beware: allowing emacs to process SendEvents opens a big security hole.
<P>
In order to allow events you have to evaluate this lisp code (press Meta-x and
enter the following expression):
<P>
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT> (setq x-allow-sendevents t)<BR>
<P>
Placing this line into your .xemacs-options file should have the same result.
</DL>

<P>
If you have problems sending events please drop me an email.
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>

Written by Heinrich Langos &lt;<A HREF="mailto:heinrich@mad.scientist.com">heinrich@mad.scientist.com</A>&gt;.
<A NAME="lbAH">&nbsp;</A>

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

		<BR><BR>
		<CENTER>[<A HREF="http://www.lirc.org/">LIRC homepage</A>]<BR>
		  <I>The LIRC Manual, last update: 17-Jan-2007</I></CENTER>
		<BR><BR>
	      </TD>
	      <TD WIDTH="15%">&#160;<BR></TD>
	    </TR>
	  </TABLE>
	</TD>
      </TR>
      <TR>
	<TD CLASS="menu" WIDTH="100%">&#160;<BR>
	</TD>
      </TR>
    </TABLE>
  </BODY>
</HTML>