pyeve v0.1 - program reacting to special keys, often found on notebooks Radovan Garabik ------------------------------------------------------------------ Requirenments: - you need working event interface in kernel, i.e. CONFIG_INPUT_EVDEV (modprobe evdev). It was tested under 2.6.* kernels, 2.4.* kernels are untested. - python - userland programs you want to execute when a particular key is pressed - i386 architecture. If you want to run pyeve on other architectures, you probably have to modify the struct format string in readevent(fd) Why another program, is "hotkeys" not good enough? It is, but I wanted something that works on the console too, and it was dead simple to write this. Installation: copy pyeve.conf to /etc, modify it according to your needs. Supplied example is working on Dell X300 notebook with Alsa sound drivers. Format of configuration file is a python dictionary, key is event code. Value is command that is executed when the key is pressed. Run use pyeve -l and then press the keys to find out correct codes. If all you get is a kernel message on console saying something like: atkbd.c: Unknown key pressed (translated set 2, code 0x89 on isa0060/serio0). then the key is not recognized by kernel and pyeve cannot work with it. Warning: the keys have often some other interpretation, and can influence your currently running userspace application as well. ACPI can also get in the way, at least on the mentioned X300 I needed to compile kernel without ACPI (but since linux does not support this model at all, it was no big loss). Licence: GPL Notes on security: pyeve needs read access to /dev/input/event0. You can either run pyeve as root, with all the resulting implications. Or you can make /dev/input/event0 readable by all the users needing to run pyeve. If you make it readable by world, be aware that anyone can read _any_ keys you press on the keyboard. This is of course of no importance on notebooks if there are no remotely connected users. Or you can create a special user with access to /dev/input/event0 and run pyeve as this user - this is probably the preferred way, but you have to mess up with creating the user and with permissions.