File: irxevent.html

package info (click to toggle)
lirc 0.7.1pre2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,852 kB
  • ctags: 2,924
  • sloc: ansic: 31,205; sh: 12,021; makefile: 631
file content (294 lines) | stat: -rw-r--r-- 8,749 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<!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>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>-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;Keyname
KEY     = &quot;Key&quot; &lt;MOD&gt;Keyname
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;]
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>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: 12-Sep-2002</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>