IRXEVENT(1) | User Commands | IRXEVENT(1) |
irxevent - infrared X-event sender
irxevent [option]... [config file]
Irxevent is a program 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, 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.
Irxevent works with the same config file as irexec and irpty (~/.config/lircrc). For a complete sample lircrc look at examples/lircrc.
Part of your .lircrc could look like this:
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
Simply said config = lines may look like this:
config = Key [shift-][ctrl-][alt-]<key> [Focus] <windowname>
| WindowID <id> | CurrentWindow | RootWindow config = Button <button> <x> <y> [Focus] <windowname> | WindowID <id>
| CurrentWindow | RootWindow config = xy_Key <x> <y> [shift-][ctrl-][alt-]<key> [Focus]
<windowname> | WindowID id | CurrentWindow | RootWindow
Some more examples:
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
In BNF this looks like:
LINE = "config =" <KEY|BUTTON|XYKEY> <TARGET> |
"config =" <KEY|BUTTON|XYKEY> "Focus" <TARGET> XYKEY = "xy_Key" <x_position> <y_position> <MOD><KEYSPEC> KEY = "Key" <MOD><KEYSPEC> MOD = ["shift-"]["numlock-"]["ctrl-"]["alt-"]["meta-"]
["numlock-"]["mod3-"]["mod4-"]["mod5-"]["altgr-"]["scrlock-"] KEYSPEC = Keyname | "KeySym:"KeySym | "KeyCode:"KeyCode BUTTON = "Button" <1..5> <x_position> <y_position> TARGET = Windowname | "WindowID" id | "CurrentWindow" | "RootWindow"
Keyname:
If you have problems finding the coordinates for a button click you can try xev -id <window_id>. The window_id can be found using xwininfo.
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.
You can however make xterm accept external events by enabling "Allow SendEvents" in the "Main Options" (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:
Yet another possibility is to start xterm like this:
xemacs will accept events if you set a built-in variable. The following was taken from the online help:
Value: t
Documentation:
*Non-nil means to allow synthetic events. Nil means they are ignored.
Beware: allowing emacs to process SendEvents opens a big security hole.
In order to allow events you have to evaluate this lisp code (press Meta-x and enter the following expression):
(setq x-allow-sendevents t)
Placing this line into your .xemacs-options file should have the same result.
If you have problems sending events please drop me an email.
Written by Heinrich Langos <heinrich@mad.scientist.com>.
The documentation for lirc is maintained as html pages. They are located under html/ in the documentation directory.
Last change: Aug 2015 | irxevent 0.10.1 |