@@ -11,6 +11,7 @@ Contents:
11
11
3.1. Compilation
12
12
3.2. Installation
13
13
3.3. Configuration
14
+ 3.3.1. Supported command attributes
14
15
3.4. Running
15
16
4. Internals
16
17
5. License
@@ -26,10 +27,10 @@ well-contained, so that support for additional platforms can be added with no or
26
27
minimal changes to the rest of the code.
27
28
28
29
It uses a plain-text configuration file which contains all the bindings. Its
29
- file format has some prediction for command modules , which would allow the user
30
- to perform some common actions (e.g. eject the CD-ROM or change the volume)
31
- without having to call external commands. Currently, though, actkbd can only
32
- execute external commands.
30
+ file format has some prediction for command attributes , which allow the user to
31
+ perform some common actions (e.g. eject the CD-ROM or change the volume) without
32
+ having to call external commands. Currently, though, actkbd can only execute
33
+ external commands, as the supported attributes only serve configuration purposes .
33
34
34
35
35
36
@@ -93,7 +94,7 @@ The default configuration file resides in $(sysconfdir)/actkbd.conf. It is a
93
94
plain-text file with each line being an entry. A proper entry has the following
94
95
format:
95
96
96
- <keys>:<event type>:<command module >:<command>
97
+ <keys>:<event type>:<attributes >:<command>
97
98
98
99
The <keys> field is a series of numeric keycodes, separated by the `+'
99
100
character. `actkbd -n -s' can be used to find out any keycodes you need, as it
@@ -102,18 +103,86 @@ will report all key presses without executing any commands.
102
103
The <event type> string field is one of `key' (key press event), `rep' (key
103
104
repeat event) or `rel' (key release event). If empty, it defaults to `key'.
104
105
105
- The <command module> field is currently ignored.
106
+ The <attributes> field contains a comma separated list of attributes. The listed
107
+ attributes can modify the execution of the supplied command or change the state
108
+ of actkbd in order to perform complex actions. The attribute actions are executed
109
+ in the listed order.
106
110
107
- The <command> field is the executed command that will be passed to system().
111
+ The <command> field is the executed command that will be passed to system().
108
112
Note that in order to have non-blocking behaviour, you have to append the `&'
109
113
character to the command, so that /bin/sh will execute it in the background.
114
+ Also keep in mind that the listed command attributes can affect the way the
115
+ command is executed, if at all. Currently system() is the only interpretter
116
+ for commands, but in the future there may be command attributes that use the
117
+ contents of this field differently, e.g. to set a sound mixer.
110
118
111
119
Lines starting with '#' are considered comments. Invalid lines are silently
112
120
ignored, unless a high enough verbosity level has been specified.
113
121
114
122
A sample actkbd.conf is included in the actkbd distribution.
115
123
116
124
125
+ 3.3.1. Supported command attributes
126
+
127
+ The supported attributes are:
128
+
129
+ * `grab': This grabs the keyboard device to block other applications from
130
+ receiving the subsequent events. This allows the user to bind commands
131
+ to keys that are not normally usable because they produce symbols that
132
+ mess with regular keyboard operation (letters, numbers e.t.c.).
133
+
134
+ * `ungrab': This releases a grabbed device, so that other programs may get the
135
+ key events. Please note that at least some versions of the X keyboard
136
+ driver (and possibly other programs) will interpret a key release event
137
+ as a full key press/release sequence even if the press event was never
138
+ received (why?). Therefore you may prefer to use the `ungrab' attribute
139
+ in release event bindings, rather than keypress ones, to ensure correct
140
+ operation.
141
+
142
+ WARNING: Using the `grab' attribute without a well thought way to invoke the
143
+ `ungrab' command can easily leave your keyboard unusable for all other
144
+ applications with no way out. You may want to invoke something like the
145
+ following:
146
+
147
+ # sleep 120; killall -9 actkbd
148
+
149
+ in a different console, while testing you configuration, to be able to
150
+ reclaim your keyboard even if the configuration file is not correct.
151
+
152
+ * `grabbed': This instructs actkbd to execute the specified command only if the
153
+ keyboard has been grabbed. This can be used to allow a key to act as an
154
+ extra Function key that adds extra functionality to the other keys.
155
+
156
+ * `ungrabbed': This instructs actkbd to execute the specified command only if
157
+ the keyboard has not been grabbed.
158
+
159
+ NOTE: If none of the `grabbed'/`ungrabbed' attributes has been used, the command
160
+ is always executed if the key mask matches. If both are specified then
161
+ the command is never executed - obviously the keyboard cannot be grabbed
162
+ and ungrabbed at the same time.
163
+
164
+ * `noexec': Do not call system() to run an external command. Useful for entries
165
+ that only serve configuration purposes.
166
+
167
+ * `exec': Use system() to run an external command here and now. Allows specific
168
+ ordering of the attribute actions with regard to the system() call.
169
+
170
+ NOTE: If none of the `noexec'/`exec' attributes has been specified, or if the
171
+ attribute list is empty, an `exec' call is implied at the end of the
172
+ list. Always use `noexec' for entries with empty/invalid commands.
173
+
174
+ * `ignrel': Ignore release events for the keys that are currently pressed. This
175
+ allows complex key combinations where the keys are pressed sequentially,
176
+ rather than simultaneously. When the key combination is completed, the
177
+ `allrel' and `rcvrel' attributes should be used to clear the key mask
178
+ and to resume the proper reception of release events.
179
+
180
+ * `allrel': Clear the pressed key mask. It is the equivalent of releasing all
181
+ pressed keys, but is not affected by the `ignrel' attribute.
182
+
183
+ * `rcvrel': Restore proper reception of key release events.
184
+
185
+
117
186
3.4. Running
118
187
119
188
Run `actkbd --help' to see the various command line options. actkbd is normally
0 commit comments