1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
4
* Copyright (C) 2008 Thomas Thurman
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation; either version 2 of the
9
* License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23
* A list of screen keybinding information.
25
* Each action which can have a keystroke bound to it is listed below.
26
* To use this file, define keybind() to be a seven-argument macro (you can
27
* throw any of the arguments you please away), include this file,
28
* and then undefine the macro again.
30
* (If you aren't familiar with this technique, sometimes called "x-macros",
31
* see DDJ of May 2001: <http://www.ddj.com/cpp/184401387>.)
33
* This makes it possible to keep all information about all the keybindings
34
* in the same place. The only exception is the code to run when an action
35
* is actually invoked; while we *could* have put that in this file, it would
36
* have made debugging ridiculously difficult. Instead, each action should
37
* have a corresponding static function named handle_<name>() in
40
* The arguments to keybind() are:
41
* 1) the name of the binding; a bareword identifier
42
* (it's fine if it happens to clash with a C reserved word)
43
* 2) the name of the function which implements it.
44
* Clearly we could have guessed this from the binding very often,
45
* but we choose to write it in full for the benefit of grep.
46
* 3) an integer parameter to pass to the handler
47
* 4) a set of boolean flags, ORed together:
48
* BINDING_PER_WINDOW - this is a window-based binding.
49
* It is only valid if there is a
50
* current window, and will operate in
51
* some way on that window.
52
* BINDING_REVERSES - the binding can reverse if you hold down Shift
53
* BINDING_IS_REVERSED - the same, but the senses are reversed from the
54
* handler's point of view (let me know if I should
55
* explain this better)
56
* or 0 if no flag applies.
58
* 5) a string representing the default binding.
59
* If this is NULL, the action is unbound by default.
60
* Please use NULL and not "disabled".
61
* 6) a short description.
62
* It must be marked translatable (i.e. inside "_(...)").
64
* Don't try to do XML entity escaping anywhere in the strings.
68
#error "keybind () must be defined when you include screen-bindings.h"
71
/***********************************/
73
#ifndef _BINDINGS_DEFINED_CONSTANTS
74
#define _BINDINGS_DEFINED_CONSTANTS 1
76
#define BINDING_PER_WINDOW 0x01
77
#define BINDING_REVERSES 0x02
78
#define BINDING_IS_REVERSED 0x04
80
#endif /* _BINDINGS_DEFINED_CONSTANTS */
82
/***********************************/
84
/* convenience, since in this file they must always be set together */
85
#define REVERSES_AND_REVERSED (BINDING_REVERSES | BINDING_IS_REVERSED)
87
keybind (switch_to_workspace_1, handle_switch_to_workspace, 0, 0, NULL,
88
_("Switch to workspace 1"))
89
keybind (switch_to_workspace_2, handle_switch_to_workspace, 1, 0, NULL,
90
_("Switch to workspace 2"))
91
keybind (switch_to_workspace_3, handle_switch_to_workspace, 2, 0, NULL,
92
_("Switch to workspace 3"))
93
keybind (switch_to_workspace_4, handle_switch_to_workspace, 3, 0, NULL,
94
_("Switch to workspace 4"))
95
keybind (switch_to_workspace_5, handle_switch_to_workspace, 4, 0, NULL,
96
_("Switch to workspace 5"))
97
keybind (switch_to_workspace_6, handle_switch_to_workspace, 5, 0, NULL,
98
_("Switch to workspace 6"))
99
keybind (switch_to_workspace_7, handle_switch_to_workspace, 6, 0, NULL,
100
_("Switch to workspace 7"))
101
keybind (switch_to_workspace_8, handle_switch_to_workspace, 7, 0, NULL,
102
_("Switch to workspace 8"))
103
keybind (switch_to_workspace_9, handle_switch_to_workspace, 8, 0, NULL,
104
_("Switch to workspace 9"))
105
keybind (switch_to_workspace_10, handle_switch_to_workspace, 9, 0, NULL,
106
_("Switch to workspace 10"))
107
keybind (switch_to_workspace_11, handle_switch_to_workspace, 10, 0, NULL,
108
_("Switch to workspace 11"))
109
keybind (switch_to_workspace_12, handle_switch_to_workspace, 11, 0, NULL,
110
_("Switch to workspace 12"))
112
/* META_MOTION_* are negative, and so distinct from workspace numbers,
113
* which are always zero or positive.
114
* If you make use of these constants, you will need to include workspace.h
115
* (which you're probably using already for other reasons anyway).
116
* If your definition of keybind() throws them away, you don't need to include
117
* workspace.h, of course.
120
keybind (switch_to_workspace_left, handle_switch_to_workspace,
121
META_MOTION_LEFT, 0, "<Control><Alt>Left",
122
_("Switch to workspace on the left of the current workspace"))
124
keybind (switch_to_workspace_right, handle_switch_to_workspace,
125
META_MOTION_RIGHT, 0, "<Control><Alt>Right",
126
_("Switch to workspace on the right of the current workspace"))
128
keybind (switch_to_workspace_up, handle_switch_to_workspace,
129
META_MOTION_UP, 0, "<Control><Alt>Up",
130
_("Switch to workspace above the current workspace"))
132
keybind (switch_to_workspace_down, handle_switch_to_workspace,
133
META_MOTION_DOWN, 0, "<Control><Alt>Down",
134
_("Switch to workspace below the current workspace"))
136
/***********************************/
138
/* The ones which have inverses. These can't be bound to any keystroke
139
* containing Shift because Shift will invert their "backward" state.
141
* TODO: "NORMAL" and "DOCKS" should be renamed to the same name as their
142
* action, for obviousness.
144
* TODO: handle_switch and handle_cycle should probably really be the
145
* same function checking a bit in the parameter for difference.
148
keybind (switch_group, handle_switch, META_TAB_LIST_GROUP,
149
BINDING_REVERSES, "<Alt>Above_Tab",
150
_("Move between windows of an application, using a popup window"))
151
keybind (switch_group_backward, handle_switch, META_TAB_LIST_GROUP,
152
REVERSES_AND_REVERSED, NULL,
153
_("Move backward between windows of an application, "
154
"using a popup window"))
155
keybind (switch_windows, handle_switch, META_TAB_LIST_NORMAL,
156
BINDING_REVERSES, "<Alt>Tab",
157
_("Move between windows, using a popup window"))
158
keybind (switch_windows_backward, handle_switch, META_TAB_LIST_NORMAL,
159
REVERSES_AND_REVERSED, NULL,
160
_("Move backward between windows, using a popup window"))
161
keybind (switch_panels, handle_switch, META_TAB_LIST_DOCKS,
162
BINDING_REVERSES, "<Control><Alt>Tab",
163
_("Move between panels and the desktop, using a popup window"))
164
keybind (switch_panels_backward, handle_switch, META_TAB_LIST_DOCKS,
165
REVERSES_AND_REVERSED, NULL,
166
_("Move backward between panels and the desktop, "
167
"using a popup window"))
169
keybind (cycle_group, handle_cycle, META_TAB_LIST_GROUP,
170
BINDING_REVERSES, "<Alt>F6",
171
_("Move between windows of an application immediately"))
172
keybind (cycle_group_backward, handle_cycle, META_TAB_LIST_GROUP,
173
REVERSES_AND_REVERSED, NULL,
174
_("Move backward between windows of an application immediately"))
175
keybind (cycle_windows, handle_cycle, META_TAB_LIST_NORMAL,
176
BINDING_REVERSES, "<Alt>Escape",
177
_("Move between windows immediately"))
178
keybind (cycle_windows_backward, handle_cycle, META_TAB_LIST_NORMAL,
179
REVERSES_AND_REVERSED, NULL,
180
_("Move backward between windows immediately"))
181
keybind (cycle_panels, handle_cycle, META_TAB_LIST_DOCKS,
182
BINDING_REVERSES, "<Control><Alt>Escape",
183
_("Move between panels and the desktop immediately"))
184
keybind (cycle_panels_backward, handle_cycle, META_TAB_LIST_DOCKS,
185
REVERSES_AND_REVERSED, NULL,
186
_("Move backward between panels and the desktop immediately"))
188
/***********************************/
190
/* These two are special pseudo-bindings that are provided for allowing
191
* custom handlers, but will never be bound to a key. While a tab
192
* grab is in effect, they are invoked for releasing the primary modifier
193
* or pressing some unbound key, respectively.
195
keybind (tab_popup_select, handle_tab_popup_select, 0, 0, NULL,
196
"Select window from tab popup")
197
keybind (tab_popup_cancel, handle_tab_popup_cancel, 0, 0, NULL,
200
/***********************************/
202
keybind (show_desktop, handle_show_desktop, 0, 0, "<Control><Alt>d",
203
_("Hide all normal windows and set focus to the desktop"))
204
keybind (panel_main_menu, handle_panel,
205
META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0, "<Alt>F1",
206
_("Show the panel's main menu"))
207
keybind (panel_run_dialog, handle_panel,
208
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0, "<Alt>F2",
209
_("Show the panel's \"Run Application\" dialog box"))
210
keybind (toggle_recording, handle_toggle_recording, 0, 0, "<Control><Shift><Alt>r",
211
_("Start or stop recording the session"))
213
/* Yes, the param is offset by one. Historical reasons. (Maybe worth fixing
214
* at some point.) The description is NULL here because the stanza is
215
* irregularly shaped in mutter.schemas.in. This will probably be fixed
218
keybind (run_command_1, handle_run_command, 0, 0, NULL, NULL)
219
keybind (run_command_2, handle_run_command, 1, 0, NULL, NULL)
220
keybind (run_command_3, handle_run_command, 2, 0, NULL, NULL)
221
keybind (run_command_4, handle_run_command, 3, 0, NULL, NULL)
222
keybind (run_command_5, handle_run_command, 4, 0, NULL, NULL)
223
keybind (run_command_6, handle_run_command, 5, 0, NULL, NULL)
224
keybind (run_command_7, handle_run_command, 6, 0, NULL, NULL)
225
keybind (run_command_8, handle_run_command, 7, 0, NULL, NULL)
226
keybind (run_command_9, handle_run_command, 8, 0, NULL, NULL)
227
keybind (run_command_10, handle_run_command, 9, 0, NULL, NULL)
228
keybind (run_command_11, handle_run_command, 10, 0, NULL, NULL)
229
keybind (run_command_12, handle_run_command, 11, 0, NULL, NULL)
230
keybind (run_command_13, handle_run_command, 12, 0, NULL, NULL)
231
keybind (run_command_14, handle_run_command, 13, 0, NULL, NULL)
232
keybind (run_command_15, handle_run_command, 14, 0, NULL, NULL)
233
keybind (run_command_16, handle_run_command, 15, 0, NULL, NULL)
234
keybind (run_command_17, handle_run_command, 16, 0, NULL, NULL)
235
keybind (run_command_18, handle_run_command, 17, 0, NULL, NULL)
236
keybind (run_command_19, handle_run_command, 18, 0, NULL, NULL)
237
keybind (run_command_20, handle_run_command, 19, 0, NULL, NULL)
238
keybind (run_command_21, handle_run_command, 20, 0, NULL, NULL)
239
keybind (run_command_22, handle_run_command, 21, 0, NULL, NULL)
240
keybind (run_command_23, handle_run_command, 22, 0, NULL, NULL)
241
keybind (run_command_24, handle_run_command, 23, 0, NULL, NULL)
242
keybind (run_command_25, handle_run_command, 24, 0, NULL, NULL)
243
keybind (run_command_26, handle_run_command, 25, 0, NULL, NULL)
244
keybind (run_command_27, handle_run_command, 26, 0, NULL, NULL)
245
keybind (run_command_28, handle_run_command, 27, 0, NULL, NULL)
246
keybind (run_command_29, handle_run_command, 28, 0, NULL, NULL)
247
keybind (run_command_30, handle_run_command, 29, 0, NULL, NULL)
248
keybind (run_command_31, handle_run_command, 30, 0, NULL, NULL)
249
keybind (run_command_32, handle_run_command, 31, 0, NULL, NULL)
251
keybind (run_command_screenshot, handle_run_command, 32, 0, "Print",
252
_("Take a screenshot"))
253
keybind (run_command_window_screenshot, handle_run_command, 33, 0,"<Alt>Print",
254
_("Take a screenshot of a window"))
256
keybind (run_command_terminal, handle_run_terminal, 0, 0, NULL, _("Run a terminal"))
258
/* No description because this is undocumented */
259
keybind (set_spew_mark, handle_set_spew_mark, 0, 0, NULL, NULL)
261
#undef REVERSES_AND_REVERSED
263
/************************ PER WINDOW BINDINGS ************************/
265
/* These take a window as an extra parameter; they have no effect
266
* if no window is active.
269
keybind (activate_window_menu, handle_activate_window_menu, 0,
270
BINDING_PER_WINDOW, "<Alt>space",
271
_("Activate the window menu"))
272
keybind (toggle_fullscreen, handle_toggle_fullscreen, 0, BINDING_PER_WINDOW,
274
_("Toggle fullscreen mode"))
275
keybind (toggle_maximized, handle_toggle_maximized, 0, BINDING_PER_WINDOW, "<Alt>F10",
276
_("Toggle maximization state"))
277
keybind (toggle_above, handle_toggle_above, 0, BINDING_PER_WINDOW, NULL,
278
_("Toggle whether a window will always be visible over other windows"))
279
keybind (maximize, handle_maximize, 0, BINDING_PER_WINDOW, NULL,
280
_("Maximize window"))
281
keybind (unmaximize, handle_unmaximize, 0, BINDING_PER_WINDOW, "<Alt>F5",
283
keybind (toggle_shaded, handle_toggle_shaded, 0, BINDING_PER_WINDOW, NULL,
284
_("Toggle shaded state"))
285
keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW, "<Alt>F9",
286
_("Minimize window"))
287
keybind (close, handle_close, 0, BINDING_PER_WINDOW, "<Alt>F4",
289
keybind (begin_move, handle_begin_move, 0, BINDING_PER_WINDOW, "<Alt>F7",
291
keybind (begin_resize, handle_begin_resize, 0, BINDING_PER_WINDOW, "<Alt>F8",
293
keybind (toggle_on_all_workspaces, handle_toggle_on_all_workspaces, 0,
294
BINDING_PER_WINDOW, NULL,
295
_("Toggle whether window is on all workspaces or just one"))
297
keybind (move_to_workspace_1, handle_move_to_workspace, 0, BINDING_PER_WINDOW,
299
_("Move window to workspace 1"))
300
keybind (move_to_workspace_2, handle_move_to_workspace, 1, BINDING_PER_WINDOW,
302
_("Move window to workspace 2"))
303
keybind (move_to_workspace_3, handle_move_to_workspace, 2, BINDING_PER_WINDOW,
305
_("Move window to workspace 3"))
306
keybind (move_to_workspace_4, handle_move_to_workspace, 3, BINDING_PER_WINDOW,
308
_("Move window to workspace 4"))
309
keybind (move_to_workspace_5, handle_move_to_workspace, 4, BINDING_PER_WINDOW,
311
_("Move window to workspace 5"))
312
keybind (move_to_workspace_6, handle_move_to_workspace, 5, BINDING_PER_WINDOW,
314
_("Move window to workspace 6"))
315
keybind (move_to_workspace_7, handle_move_to_workspace, 6, BINDING_PER_WINDOW,
317
_("Move window to workspace 7"))
318
keybind (move_to_workspace_8, handle_move_to_workspace, 7, BINDING_PER_WINDOW,
320
_("Move window to workspace 8"))
321
keybind (move_to_workspace_9, handle_move_to_workspace, 8, BINDING_PER_WINDOW,
323
_("Move window to workspace 9"))
324
keybind (move_to_workspace_10, handle_move_to_workspace, 9, BINDING_PER_WINDOW,
326
_("Move window to workspace 10"))
327
keybind (move_to_workspace_11, handle_move_to_workspace, 10, BINDING_PER_WINDOW,
329
_("Move window to workspace 11"))
330
keybind (move_to_workspace_12, handle_move_to_workspace, 11, BINDING_PER_WINDOW,
332
_("Move window to workspace 12"))
334
/* META_MOTION_* are negative, and so distinct from workspace numbers,
335
* which are always zero or positive.
336
* If you make use of these constants, you will need to include workspace.h
337
* (which you're probably using already for other reasons anyway).
338
* If your definition of keybind() throws them away, you don't need to include
339
* workspace.h, of course.
342
keybind (move_to_workspace_left, handle_move_to_workspace,
343
META_MOTION_LEFT, BINDING_PER_WINDOW, "<Control><Shift><Alt>Left",
344
_("Move window one workspace to the left"))
345
keybind (move_to_workspace_right, handle_move_to_workspace,
346
META_MOTION_RIGHT, BINDING_PER_WINDOW, "<Control><Shift><Alt>Right",
347
_("Move window one workspace to the right"))
348
keybind (move_to_workspace_up, handle_move_to_workspace,
349
META_MOTION_UP, BINDING_PER_WINDOW, "<Control><Shift><Alt>Up",
350
_("Move window one workspace up"))
351
keybind (move_to_workspace_down, handle_move_to_workspace,
352
META_MOTION_DOWN, BINDING_PER_WINDOW, "<Control><Shift><Alt>Down",
353
_("Move window one workspace down"))
355
keybind (raise_or_lower, handle_raise_or_lower, 0, BINDING_PER_WINDOW, NULL,
356
_("Raise window if it's covered by another window, otherwise lower it"))
357
keybind (raise, handle_raise, 0, BINDING_PER_WINDOW, NULL,
358
_("Raise window above other windows"))
359
keybind (lower, handle_lower, 0, BINDING_PER_WINDOW, NULL,
360
_("Lower window below other windows"))
362
keybind (maximize_vertically, handle_maximize_vertically, 0,
363
BINDING_PER_WINDOW, NULL,
364
_("Maximize window vertically"))
366
keybind (maximize_horizontally, handle_maximize_horizontally, 0,
367
BINDING_PER_WINDOW, NULL,
368
_("Maximize window horizontally"))
370
keybind (move_to_corner_nw, handle_move_to_corner_nw, 0,
371
BINDING_PER_WINDOW, NULL,
372
_("Move window to north-west (top left) corner"))
373
keybind (move_to_corner_ne, handle_move_to_corner_ne, 0,
374
BINDING_PER_WINDOW, NULL,
375
_("Move window to north-east (top right) corner"))
376
keybind (move_to_corner_sw, handle_move_to_corner_sw, 0,
377
BINDING_PER_WINDOW, NULL,
378
_("Move window to south-west (bottom left) corner"))
379
keybind (move_to_corner_se, handle_move_to_corner_se, 0,
380
BINDING_PER_WINDOW, NULL,
381
_("Move window to south-east (bottom right) corner"))
383
keybind (move_to_side_n, handle_move_to_side_n, 0,
384
BINDING_PER_WINDOW, NULL,
385
_("Move window to north (top) side of screen"))
386
keybind (move_to_side_s, handle_move_to_side_s, 0,
387
BINDING_PER_WINDOW, NULL,
388
_("Move window to south (bottom) side of screen"))
389
keybind (move_to_side_e, handle_move_to_side_e, 0,
390
BINDING_PER_WINDOW, NULL,
391
_("Move window to east (right) side of screen"))
392
keybind (move_to_side_w, handle_move_to_side_w, 0,
393
BINDING_PER_WINDOW, NULL,
394
_("Move window to west (left) side of screen"))
395
keybind (move_to_center, handle_move_to_center, 0,
396
BINDING_PER_WINDOW, NULL,
397
_("Move window to center of screen"))
399
/* eof all-keybindings.h */