Added lirc.
[irreco.git] / lirc-0.8.4a / doc / html / irxevent.html
blob066ef9b90956a7113886e458031d9a56045192d4
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <HTML>
4 <HEAD>
5 <TITLE>LIRC - Linux Infrared Remote Control</TITLE>
6 <LINK REL=stylesheet TYPE="text/css" HREF="../lirc.css">
7 <LINK REL="shortcut icon" HREF="../favicon.ico">
8 <META NAME="description" CONTENT="LIRC - Linux Infra-red Remote Control">
9 <META NAME="keywords" CONTENT="linux, kernel module, remote control, animax, multimedia">
10 </HEAD>
12 <BODY BACKGROUND="../images/marb18.jpg"
13 BGCOLOR="#FFFFFF" TEXT="#000000" ALINK="#8080FF">
14 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
15 <TR>
16 <TD CLASS="menu" WIDTH="100%" HEIGHT="150">
17 <IMG SRC="../images/diode.gif" ALT=""
18 WIDTH="300" HEIGHT="150" BORDER="0" HSPACE="20"
19 VSPACE="0" ALIGN="LEFT">
20 <IMG SRC="../images/lirc.gif" ALT=""
21 WIDTH="300" HEIGHT="150" BORDER="0" HSPACE="20"
22 VSPACE="0" ALIGN="RIGHT">
23 </TD>
24 </TR>
25 <TR>
26 <TD WIDTH="100%">&#160;<BR>
27 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
28 <TR>
29 <TD WIDTH="15%">&#160;<BR></TD>
30 <TD WIDTH="70%" ALIGN="LEFT" VALIGN="TOP">&#160;<BR>
32 <!-- Text ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
34 <H1>IRXEVENT</H1>
35 <HR>
37 <A NAME="lbAB">&nbsp;</A>
38 <H2>NAME</H2>
40 irxevent - infrared X-event sender
41 <A NAME="lbAC">&nbsp;</A>
42 <H2>SYNOPSIS</H2>
44 <B>irxevent</B>
46 [<I>option</I>]... [<I>config file</I>]
47 <A NAME="lbAD">&nbsp;</A>
48 <H2>DESCRIPTION</H2>
50 Irxevent is a program that I wrote to send button clicks and key presses to X
51 applications triggered by a LIRC driven remote control. You can control your
52 favorite CD/MP3 player or your TV tuner program or any other X application
53 that responds to keyboard or mouse input. If you like to you can send emacs
54 ^X^S from your armchair.
55 <P>
56 Irxevent is a complement to irexec and irpty.
57 <DL COMPACT>
58 <DT><B>-d</B> <B>--daemon</B><DD>
59 fork and run in background
60 <DT><B>-h</B> <B>--help</B><DD>
61 display usage summary
62 <DT><B>-V</B> <B>--version</B><DD>
63 display version
64 </DL>
65 <A NAME="lbAE">&nbsp;</A>
66 <H2>FILES</H2>
68 Irxevent works with the same config file as irexec and irpty (~/.lircrc). For
69 a complete sample .lircrc look at examples/lircrc.
70 <P>
71 <B>Part of your .lircrc could look like this:</B>
73 <P>
74 <PRE>
75 <DL COMPACT><DT><DD>begin
76 prog = irxevent
77 button = VIDEO_UP
78 config = Key SHIFT-KP_Add CurrentWindow
79 end
80 begin
81 prog = irxevent
82 button = VIDEO_DOWN
83 config = Key SHIFT-KP_Subtract CurrentWindow
84 end
85 begin
86 prog = irxevent
87 button = STOP
88 config = Key ctrl-c CurrentWindow
89 end
90 begin
91 prog = irxevent
92 button = 0
93 config = Key f xawtv
94 config = Key f xawtv
95 end
96 begin
97 prog = irxevent
98 button = POWER
99 config = Key q xawtv
101 begin
102 prog = irxevent
103 button = CH_DOWN
104 config = Button 1 329 92 kscd
106 begin
107 prog = irxevent
108 button = UP
109 config = Button 1 110 80 GQmpeg
111 begin
112 prog = irxevent
113 button = DOWN
114 config = Button 1 130 80 GQmpeg
116 </DL>
117 </PRE>
120 <B>Simply said </B><I>config</I><B> = lines may look like this:</B>
123 <PRE>
124 <DL COMPACT><DT><DD>config = Key [shift-][ctrl-][alt-]&lt;key&gt; [Focus] &lt;windowname&gt;
125 | WindowID &lt;id&gt; | CurrentWindow | RootWindow
126 config = Button &lt;button&gt; &lt;x&gt; &lt;y&gt; [Focus] &lt;windowname&gt; | WindowID &lt;id&gt;
127 | CurrentWindow | RootWindow
128 config = xy_Key &lt;x&gt; &lt;y&gt; [shift-][ctrl-][alt-]&lt;key&gt; [Focus]
129 &lt;windowname&gt; | WindowID id | CurrentWindow | RootWindow
130 </DL>
131 </PRE>
134 <B>some more examples:</B>
137 <PRE>
138 <DL COMPACT><DT><DD>config = Key Up xawtv
139 config = Key Down xawtv
140 config = Button 1 50 110 xclickme
141 config = Key q xawtv
142 config = Key ctrl-c mpg123
143 config = Key shift-Page_Up rxvt
144 </DL>
145 </PRE>
148 <B>In BNF this looks like:</B>
151 <DL COMPACT><DT><DD>
152 <PRE>
153 LINE = &quot;config =&quot; &lt;KEY|BUTTON|XYKEY&gt; &lt;TARGET&gt; |
154 &quot;config =&quot; &lt;KEY|BUTTON|XYKEY&gt; &quot;Focus&quot; &lt;TARGET&gt;
155 XYKEY = &quot;xy_Key&quot; &lt;x_position&gt; &lt;y_position&gt; &lt;MOD&gt;&lt;KEYSPEC&gt;
156 KEY = &quot;Key&quot; &lt;MOD&gt;&lt;KEYSPEC&gt;
157 MOD = [&quot;shift-&quot;][&quot;numlock-&quot;][&quot;ctrl-&quot;][&quot;alt-&quot;][&quot;meta-&quot;]
158 [&quot;numlock-&quot;][&quot;mod3-&quot;][&quot;mod4-&quot;][&quot;scrlock-&quot;]
159 KEYSPEC = Keyname | &quot;KeySym:&quot;KeySym | &quot;KeyCode:&quot;KeyCode
160 BUTTON = &quot;Button&quot; &lt;1..5&gt; &lt;x_position&gt; &lt;y_position&gt;
161 TARGET = Windowname | &quot;WindowID&quot; id | &quot;CurrentWindow&quot; | &quot;RootWindow&quot;
162 </PRE>
165 <I>Keyname:</I>
167 <DL COMPACT><DT><DD>
168 is the key symbol that is declared in X windows. E.g. &quot;Up&quot; refers to the
169 cursor arrow pointing up. &quot;KP_Add&quot; is the plus sign on the key pad. Just take
170 a look at irxevent.keys (in the documentation directory) if you are not sure
171 about a symbol's name.
172 </DL>
174 <I>KeySym:</I>
176 <DL COMPACT><DT><DD>
177 number as returned by XStringToKeysym(3x).
178 </DL>
180 <I>KeyCode:</I>
182 <DL COMPACT><DT><DD>
183 number as returned by XKeysymToKeycode(3x).
184 </DL>
186 <I>Windowname:</I>
188 <DL COMPACT><DT><DD>
189 can be the first characters of the window name displayed by the window manager
190 or the name that is displayed below the icon. Some programs use the name
191 displayed by the window manager to show a lot of status information but don't
192 change the icon name (like xawtv). Others append information to the window
193 name (&quot;GQmpeg - kill_windooz.mp3&quot;). If neither window name nor icon name match
194 the given Windowname information from XClassHint(3x) will be checked.
195 </DL>
197 <I>CurrentWindow:</I>
199 <DL COMPACT><DT><DD>
200 refers to the active window as returned by XGetInputFocus(3x). Most times this
201 is the window with your mouse pointer in it.
202 </DL>
204 <I>RootWindow:</I>
206 <DL COMPACT><DT><DD>
207 refers to the <I>root</I> window as returned by RootWindow(3x). You may need
208 this to send events to the window manager.
209 </DL>
211 <I>WindowID id:</I>
213 <DL COMPACT><DT><DD>
214 refers to the window with window identifier <I>id</I>. <I>id</I> should be a
215 decimal number. It is useful when irxevent can't find the desired window by
216 other means.
217 </DL>
219 <I>Focus:</I>
221 <DL COMPACT><DT><DD>
222 will send the specified event to the given window only if it currently has the
223 input focus. This of course does not make much sense when combined with
224 CurrentWindow.
225 </DL>
227 </DL>
229 <A NAME="lbAF">&nbsp;</A>
230 <H2>TROUBLESHOOTING</H2>
233 If you have problems finding the coordinates for a button click you can try
234 xev -id &lt;window_id&gt;. The window_id can be found using xwininfo. If xev and
235 xwininfo are not part of your distribution you can find them at a FTP server
236 using the search engine at: <A HREF="http://ftpsearch.ntnu.no/">http://ftpsearch.ntnu.no/</A> . xev also reports the
237 names of key symbols like &quot;Control_L&quot; (your left control key) or &quot;KP_Subtract&quot;
238 (the 'minus' key on your keypad).
240 There are programs that do not accept any synthetic X-events by default
241 because they can cause security problems. Currently xterm and xemacs are known
242 to ignore events simulated by irxevent.
244 You can however make xterm accept external events by enabling &quot;Allow
245 SendEvents&quot; in the &quot;Main Options&quot; (hold down the Ctrl button and press the
246 left mouse button inside the xterm window). You can as well place this line
247 into your .Xresources file to change this permanently:
249 <DL COMPACT><DT><DD>
250 XTerm.vt100.allowSendEvents: true
251 </DL>
254 Yet another possibility is to start xterm like this:
256 <DL COMPACT><DT><DD>
257 xterm -xrm &quot;XTerm.vt100.allowSendEvents: true&quot;
258 </DL>
261 xemacs will accept events if you set a built-in variable. The following was
262 taken from the online help:
264 <DL COMPACT><DT><DD>
265 `x-allow-sendevents' is a built-in boolean variable.
267 Value: t
269 Documentation:
271 *Non-nil means to allow synthetic events. Nil means they are ignored.
273 Beware: allowing emacs to process SendEvents opens a big security hole.
275 In order to allow events you have to evaluate this lisp code (press Meta-x and
276 enter the following expression):
278 <TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT> (setq x-allow-sendevents t)<BR>
280 Placing this line into your .xemacs-options file should have the same result.
281 </DL>
284 If you have problems sending events please drop me an email.
285 <A NAME="lbAG">&nbsp;</A>
286 <H2>AUTHOR</H2>
288 Written by Heinrich Langos &lt;<A HREF="mailto:heinrich@mad.scientist.com">heinrich@mad.scientist.com</A>&gt;.
289 <A NAME="lbAH">&nbsp;</A>
291 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
293 <BR><BR>
294 <CENTER>[<A HREF="http://www.lirc.org/">LIRC homepage</A>]<BR>
295 <I>The LIRC Manual, last update: 12-Oct-2008</I></CENTER>
296 <BR><BR>
297 </TD>
298 <TD WIDTH="15%">&#160;<BR></TD>
299 </TR>
300 </TABLE>
301 </TD>
302 </TR>
303 <TR>
304 <TD CLASS="menu" WIDTH="100%">&#160;<BR>
305 </TD>
306 </TR>
307 </TABLE>
308 </BODY>
309 </HTML>