Skip to content

Commit 5437069

Browse files
committed
Release version 0.0.1
0 parents  commit 5437069

15 files changed

+1554
-0
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Theodoros V. Kalamatianos <[email protected]>

COPYING

+340
Large diffs are not rendered by default.

ChangeLog

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fri Aug 19 00:48:28 EEST 2005 - Theodoros V. Kalamatianos <[email protected]>
2+
* Initial testing release (0.0.1)

FAQ

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
* Why yet another keyboard daemon ?
2+
3+
Because I needed a daemon that:
4+
5+
- is small and simple
6+
- is NOT X Window based, so that it's usable even from the console
7+
- can execute external programs
8+
- can handle key combinations
9+
10+
11+
* What about the other daemons
12+
13+
I had a look at the following:
14+
15+
- lineakd:
16+
pros: modules
17+
cons: X-based
18+
19+
- pbbuttonsd:
20+
pros: not X-based (IIRC)
21+
cons: could not find how to execute external programs, Mac-centric,
22+
bloated with PM stuff and other non-keyboard stuff.
23+
24+
- esekeyd
25+
pros: not X-based, executes external programs
26+
cons: does not support key combinations
27+
28+
I used a self-modified (i.e. with limited combination support) esekeyd
29+
for quite some time, until I decided to write my own daemon.
30+
31+
- keyed
32+
pros: not X-based, executes external programs
33+
cons: alpha, with fork() issues (according to the author)
34+
35+
- evkeyd
36+
pros: not X-based
37+
cons: no external program execution, no key combinations
38+
39+
40+
* Does it work ?
41+
42+
I have performed some minimal testing and it seems to work fine. I will have
43+
to receive quite a lot of feedback before I mark it as stable, though.
44+
45+
46+
* How does it work ?
47+
48+
To find out read the `Internals' section in the README. Then read the source
49+
code itself for details.
50+
51+
52+
* I found a bug !
53+
54+
Good! Now report it to me at <[email protected]>... or even better fix
55+
it and send a patch!
56+
57+
58+
* How can I help ?
59+
60+
- Test it!
61+
- Report bugs!
62+
- Ideas, suggestions e.t.c. are welcome. Patches even more :-D
63+
- Occasionally you may drop a line to say that it worked for you. Positive
64+
feedback is just as important.
65+
66+
67+
* I don't like your coding style
68+
69+
I don't like yours either.
70+
71+
72+
* Who wrote it ?
73+
74+
Me, Theodoros Kalamatianos, a student at the department of Electric and Computer
75+
Engineering of the National Technical University of Athens. For purposes related
76+
to actkbd I may be reached at <[email protected]>.
77+
78+
79+
* Under what license is it released ?
80+
81+
Naturally, the GNU General Public License. The full text of the GPL is included
82+
in the actkbd tarball.

Makefile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
prefix := /usr/local
2+
sbindir := $(prefix)/sbin
3+
4+
CFLAGS := -O2 -Wall $(DEBUG)
5+
6+
7+
8+
all: actkbd
9+
10+
actkbd: actkbd.o mask.o config.o linux.o
11+
12+
actkbd.o : actkbd.h
13+
mask.o : actkbd.h
14+
config.o : actkbd.h
15+
16+
linux.o : actkbd.h
17+
18+
actkbd.h: version.h
19+
20+
install: all
21+
install -D -m755 actkbd $(sbindir)/actkbd
22+
23+
clean:
24+
rm -f actkbd *.o

NEWS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
0.0.1:
2+
* Initial testing release

README

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
actkbd - A keyboard shortcut daemon
2+
3+
4+
5+
Contents:
6+
7+
1. Introduction
8+
2. Platforms
9+
3. Setup
10+
3.1. Compilation
11+
3.2. Installation
12+
3.3. Configuration
13+
3.4. Running
14+
4. Internals
15+
5. License
16+
6. Authors
17+
18+
19+
1. Introduction
20+
21+
actkbd is a simple daemon that binds actions to keyboard events. It recognises
22+
key combinations and can handle press, repeat and release events. Currently it
23+
only supports the linux-2.6 evdev interface, but the platform-specific code is
24+
well-contained, so that support for additional platforms can be added with no
25+
or minimal changes to the rest of the code.
26+
27+
It uses a plain-text configuration file which contains all the bindings. Its
28+
file format has some prediction for command modules, which would allow the user
29+
to perform some common actions (e.g. eject the CD-ROM or change the volume)
30+
without having to call external commands. Currently, though, actkbd can only
31+
execute external commands.
32+
33+
34+
35+
2. Platforms
36+
37+
Currently only the following platforms are supported:
38+
39+
* Linux 2.6.x
40+
41+
The following platforms will probably never be supported:
42+
43+
* Windows - no POSIX, no support
44+
* BeOS - unless someone can resurrect it
45+
46+
47+
48+
3. Setup
49+
50+
3.1. Compilation
51+
52+
A simple call to `make' is normally all you need to compile actkbd:
53+
54+
$ make
55+
56+
You can override the CFLAGS variable to provide optimisation flags e.t.c. The
57+
DEBUG variable can be used to enable debugging - if you are using gcc, setting
58+
DEBUG to "-g" would probably do.
59+
60+
61+
3.2. Installation
62+
63+
First verify with `make -n install' the installation paths. By default, the
64+
installation prefix is /usr/local and the actkbd daemon binary is installed in
65+
$(prefix)/sbin. You can set the prefix and sbindir variables to override these
66+
defaults. Then run `make install' as root to perform the actual installation:
67+
68+
# make install
69+
70+
71+
3.3. Configuration
72+
73+
The default configuration file resides in /etc/actkbd.conf. It is a plain-text
74+
file with each line being an entry. A proper entry has the following format:
75+
76+
<keys>:<event type>:<command module>:<command>
77+
78+
The <keys> field is a series of numeric keycodes, separated by the `+'
79+
character. `actkbd -n -s' can be used to find out any keycodes you need.
80+
81+
The <event type> string field is one of `key' (key press event), `rep' (key
82+
repeat event) or `rel' (key release event). If empty, it defaults to `key'.
83+
84+
The <command module> field is currently ignored.
85+
86+
The <command> field is the executed command that will be passed to system(). Note
87+
that in order to have non-blocking behaviour, you have to append the `&' character
88+
to the command, so that /bin/sh will execute it in the background.
89+
90+
Lines starting with '#' are considered comments. Invalid lines are silently
91+
ignored, unless a high enough verbosity level has been specified.
92+
93+
94+
3.4. Running
95+
96+
Run `actkbd --help' to see the various command line options. actkbd is normally
97+
able to auto-detect your keyboard device, therefore you do not need to specify
98+
it. For the most common case - a daemon with the default configuration file in
99+
/etc - the following command should suffice:
100+
101+
# actkbd -D -q
102+
103+
Note that sending HUP to actkbd will cause it to reload the configuration file.
104+
105+
106+
4. Internals
107+
108+
The most interesting/messy part of evkey is the code that keeps track of which
109+
keys are pressed each moment. It uses a bitmask with one bit for each available
110+
key. When press/repeat events are received, the corresponding bit is set and it
111+
becomes unset when a release event is received for that key. To match key events
112+
with the corresponding actions, each valid configuration file entry has its key
113+
field transformed to a bitmask. After that, whenever a new event is received,
114+
the status bitmask is matched against all configuration entry bitmasks and the
115+
first one to match (if any) is used and the corresponding command is executed.
116+
117+
Please note that the platform specific code is contained in <platform>.c (.e.g.
118+
linux.c). This file implements a generic interface to keyboard events, hiding
119+
each system's intricacies from the rest of code. It is also the file that has
120+
to be written/ported to add support for a new platform.
121+
122+
For any additional details the best documentation is probalby the source code
123+
itself.
124+
125+
126+
5. License
127+
128+
actkbd is released under the GNU General Public License version 2. The full
129+
text of the GPL is in the COPYING file that should be included in the actkbd
130+
distribution.
131+
132+
133+
6. Authors
134+
135+
Original author:
136+
Theodoros V. Kalamatianos <[email protected]>

TODO

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
* Find out what happens if the keyboard device suddenly disappears - I have
2+
to find a USB keyboard to test this. Make sure we handle this gracefully.
3+
4+
* Perform some testing on non-IA32 platforms, especially on 64-bit and
5+
big-endian CPUs - some external feedback is welcome.
6+
7+
* Check/Implement support for linux-2.4 kernels. I can't even remember whether
8+
those had a proper event interface...
9+
10+
* Implement the module subsystem. Modules to control sound mixers e.t.c could
11+
be built.
12+
13+
* Use select() to handle multiple keyboards, instead of just the first one,
14+
and get a USB keyboard to test it.
15+
16+
* Dynamically attach to new keyboards - the select() infrastrusture is a
17+
prerequisite for this - can we do this without periodically reading the
18+
/proc/bus/input/devices file ?
19+
20+
* Per-keyboard configuration - this may never be implemented since it would
21+
complicate the code. Perhaps a hotplug script could handle this better.
22+
23+
* Support additional platforms. To do this, alternatives to linux.c must be
24+
written and the build system must become smarter (autotools ?). I would
25+
also need maintainers for any platform apart from Linux, since I do not
26+
see myself installing another OS any time soon.
27+
28+
* Find out if there are any good reasons (security ?) to replace the call
29+
to system().
30+
31+
* Add support for symbolic key names in the configuration file. Can we do
32+
do this while still keeping the code relatively portable and without using
33+
huge fixed keymaps ?

0 commit comments

Comments
 (0)