bindinds: add support for alt/ctrl/shift modifiers and escape key
[ncmpcpp.git] / doc / bindings
bloba0f89c52ad160850bf8dd5ac486ea9f2d940924e
1 ##########################################################
2 ## this is example bindings configuration file, copy it ##
3 ## to ~/.ncmpcpp/bindings and set up your preferences   ##
4 ##########################################################
5 ##
6 ##### General rules #####
7 ##
8 ## 1) Because each action has runtime checks whether it's
9 ##    ok to run it, a few actions can be bound to one key.
10 ##    Actions will be bound in order given in configuration
11 ##    file. When a key is pressed, first action in order
12 ##    will test itself whether it's possible to run it. If
13 ##    test succeeds, action is executed and other actions
14 ##    bound to this key are ignored. If it doesn't, next
15 ##    action in order tests itself etc.
17 ## 2) It's possible to bind more that one action at once
18 ##    to a key. It can be done using the following syntax:
20 ##    def_key "key"
21 ##      action1
22 ##      action2
23 ##      ...
25 ##    This creates a chain of actions. When such chain is
26 ##    executed, each action in chain is run until the end of
27 ##    chain is reached or one of its actions fails to execute
28 ##    due to its requirements not being met. If multiple actions
29 ##    and/or chains are bound to the same key, they will be
30 ##    consecutively run until one of them gets fully executed.
32 ## 3) When ncmpcpp starts, bindings configuration file is
33 ##    parsed and then ncmpcpp provides "missing pieces"
34 ##    of default keybindings. If you want to disable some
35 ##    bindings, there is a special action called 'dummy'
36 ##    for that purpose. Eg. if you want to disable ability
37 ##    to crop playlists, you need to put the following
38 ##    into configuration file:
40 ##    def_key "C"
41 ##      dummy
43 ##    After that ncmpcpp will not bind any default action
44 ##    to this key.
46 ## 4) To let you write simple macros, the following special
47 ##    actions are provided:
49 ##    - push_character "character" - pushes given special
50 ##      character into input queue, so it will be immediately
51 ##      picked by ncmpcpp upon next call to readKey function.
52 ##      Accepted values: mouse, up, down, page_up, page_down,
53 ##      home, end, space, enter, insert, delete, left, right,
54 ##      tab, ctrl_a, ctrl_b, ..., ctrl_z, ctrl_[, ctrl_\\,
55 ##      ctrl_], ctrl_^, ctrl__, f1, f2, ..., f12, backspace.
56 ##      In addition, most of these names can be prefixed with
57 ##      alt_/ctrl_/shift_ to be recognized with the appropriate
58 ##      modifier key(s).
60 ##    - push_characters "string" - pushes given string into
61 ##      input queue.
63 ##    - require_runnable "action" - checks whether given action
64 ##      is runnable and fails if it isn't. This is especially
65 ##      useful when mixed with previous two functions. Consider
66 ##      the following macro definition:
68 ##      def_key "key"
69 ##        push_characters "custom_filter"
70 ##        apply_filter
72 ##      If apply_filter can't be currently run, we end up with
73 ##      sequence of characters in input queue which will be
74 ##      treated just as we typed them. This may lead to unexpected
75 ##      results (in this case 'c' will most likely clear current
76 ##      playlist, 'u' will trigger database update, 's' will stop
77 ##      playback etc.). To prevent such thing from happening, we
78 ##      need to change above definition to this one:
80 ##      def_key "key"
81 ##        require_runnable "apply_filter"
82 ##        push_characters "custom_filter"
83 ##        apply_filter
85 ##      Here, first we test whether apply_filter can be actually run
86 ##      before we stuff characters into input queue, so if condition
87 ##      is not met, whole chain is aborted and we're fine.
89 ##    - require_screen "screen" - checks whether given screen is
90 ##      currently active. accepted values: browser, clock, help,
91 ##      media_library, outputs, playlist, playlist_editor,
92 ##      search_engine, tag_editor, visualizer, last_fm, lyrics,
93 ##      selected_items_adder, server_info, song_info,
94 ##      sort_playlist_dialog, tiny_tag_editor.
96 ##    - run_external_command "command" - runs given command using
97 ##      system() function.
99 ## 5) In addition to binding to a key, you can also bind actions
100 ##    or chains of actions to a command. If it comes to commands,
101 ##    syntax is very similar to defining keys. Here goes example
102 ##    definition of a command:
104 ##      def_command "quit" [deferred]
105 ##        stop
106 ##        quit
108 ##    If you execute the above command (which can be done by
109 ##    invoking action execute_command, typing 'quit' and pressing
110 ##    enter), ncmpcpp will stop the player and then quit. Note the
111 ##    presence of word 'deferred' enclosed in square brackets. It
112 ##    tells ncmpcpp to wait for confirmation (ie. pressing enter)
113 ##    after you typed quit. Instead of 'deferred', 'immediate'
114 ##    could be used. Then ncmpcpp will not wait for confirmation
115 ##    (enter) and will execute the command the moment it sees it.
117 ## Note: There is a difference between:
119 ##         def_key "key"
120 ##           action1
122 ##         def_key "key"
123 ##           action2
125 ##       and
127 ##         def_key "key"
128 ##           action1
129 ##           action2
131 ##      First one binds two single actions to the same key whilst
132 ##      second one defines a chain of actions. The behavior of
133 ##      these two is different and is described in (1) and (2).
135 ## Note: Function def_key accepts non-ascii characters.
137 ##### List of unbound actions #####
139 ## The following actions are not bound to any key/command:
141 ##  - set_volume
144 #def_key "mouse"
145 #  mouse_event
147 #def_key "up"
148 #  scroll_up
150 #def_key "down"
151 #  scroll_down
153 #def_key "["
154 #  scroll_up_album
156 #def_key "]"
157 #  scroll_down_album
159 #def_key "{"
160 #  scroll_up_artist
162 #def_key "}"
163 #  scroll_down_artist
165 #def_key "page_up"
166 #  page_up
168 #def_key "page_down"
169 #  page_down
171 #def_key "home"
172 #  move_home
174 #def_key "end"
175 #  move_end
177 #def_key "insert"
178 #  select_item
180 #def_key "space"
181 #  press_space
183 #def_key "enter"
184 #  press_enter
186 #def_key "delete"
187 #  delete_playlist_items
189 #def_key "delete"
190 #  delete_browser_items
192 #def_key "delete"
193 #  delete_stored_playlist
195 #def_key "right"
196 #  next_column
198 #def_key "right"
199 #  slave_screen
201 #def_key "right"
202 #  volume_up
204 #def_key "+"
205 #  volume_up
207 #def_key "left"
208 #  previous_column
210 #def_key "left"
211 #  master_screen
213 #def_key "left"
214 #  volume_down
216 #def_key "-"
217 #  volume_down
219 #def_key ":"
220 #  execute_command
222 #def_key "tab"
223 #  next_screen
225 #def_key "shift_tab"
226 #  previous_screen
228 #def_key "f1"
229 #  show_help
231 #def_key "1"
232 #  show_playlist
234 #def_key "2"
235 #  show_browser
237 #def_key "2"
238 #  change_browse_mode
240 #def_key "3"
241 #  show_search_engine
243 #def_key "3"
244 #  reset_search_engine
246 #def_key "4"
247 #  show_media_library
249 #def_key "4"
250 #  toggle_media_library_columns_mode
252 #def_key "5"
253 #  show_playlist_editor
255 #def_key "6"
256 #  show_tag_editor
258 #def_key "7"
259 #  show_outputs
261 #def_key "8"
262 #  show_visualizer
264 #def_key "="
265 #  show_clock
267 #def_key "@"
268 #  show_server_info
270 #def_key "s"
271 #  stop
273 #def_key "p"
274 #  pause
276 #def_key ">"
277 #  next
279 #def_key "<"
280 #  previous
282 #def_key "ctrl_h"
283 #  jump_to_parent_directory
285 #def_key "ctrl_h"
286 #  replay_song
288 #def_key "backspace"
289 #  jump_to_parent_directory
291 #def_key "backspace"
292 #  replay_song
294 #def_key "f"
295 #  seek_forward
297 #def_key "b"
298 #  seek_backward
300 #def_key "r"
301 #  toggle_repeat
303 #def_key "z"
304 #  toggle_random
306 #def_key "y"
307 #  save_tag_changes
309 #def_key "y"
310 #  start_searching
312 #def_key "y"
313 #  toggle_single
315 #def_key "R"
316 #  toggle_consume
318 #def_key "Y"
319 #  toggle_replay_gain_mode
321 #def_key "T"
322 #  toggle_add_mode
324 #def_key "|"
325 #  toggle_mouse
327 #def_key "#"
328 #  toggle_bitrate_visibility
330 #def_key "Z"
331 #  shuffle
333 #def_key "x"
334 #  toggle_crossfade
336 #def_key "X"
337 #  set_crossfade
339 #def_key "u"
340 #  update_database
342 #def_key "ctrl_v"
343 #  sort_playlist
345 #def_key "ctrl_r"
346 #  reverse_playlist
348 #def_key "/"
349 #  find
351 #def_key "/"
352 #  find_item_forward
354 #def_key "?"
355 #  find
357 #def_key "?"
358 #  find_item_backward
360 #def_key "."
361 #  next_found_item
363 #def_key ","
364 #  previous_found_item
366 #def_key "w"
367 #  toggle_find_mode
369 #def_key "e"
370 #  edit_song
372 #def_key "e"
373 #  edit_library_tag
375 #def_key "e"
376 #  edit_library_album
378 #def_key "e"
379 #  edit_directory_name
381 #def_key "e"
382 #  edit_playlist_name
384 #def_key "e"
385 #  edit_lyrics
387 #def_key "i"
388 #  show_song_info
390 #def_key "I"
391 #  show_artist_info
393 #def_key "g"
394 #  jump_to_position_in_song
396 #def_key "l"
397 #  show_lyrics
399 #def_key "v"
400 #  reverse_selection
402 #def_key "V"
403 #  remove_selection
405 #def_key "B"
406 #  select_album
408 #def_key "a"
409 #  add_selected_items
411 #def_key "c"
412 #  clear_playlist
414 #def_key "c"
415 #  clear_main_playlist
417 #def_key "C"
418 #  crop_playlist
420 #def_key "C"
421 #  crop_main_playlist
423 #def_key "m"
424 #  move_sort_order_up
426 #def_key "m"
427 #  move_selected_items_up
429 #def_key "m"
430 #  toggle_media_library_sort_mode
432 #def_key "m"
433 #  set_visualizer_sample_multiplier
435 #def_key "n"
436 #  move_sort_order_down
438 #def_key "n"
439 #  move_selected_items_down
441 #def_key "M"
442 #  move_selected_items_to
444 #def_key "A"
445 #  add
447 #def_key "S"
448 #  save_playlist
450 #def_key "o"
451 #  jump_to_playing_song
453 #def_key "G"
454 #  jump_to_browser
456 #def_key "G"
457 #  jump_to_playlist_editor
459 #def_key "~"
460 #  jump_to_media_library
462 #def_key "E"
463 #  jump_to_tag_editor
465 #def_key "U"
466 #  toggle_playing_song_centering
468 #def_key "P"
469 #  toggle_display_mode
471 #def_key "\\"
472 #  toggle_interface
474 #def_key "!"
475 #  toggle_separators_between_albums
477 #def_key "L"
478 #  toggle_lyrics_fetcher
480 #def_key "F"
481 #  toggle_fetching_lyrics_in_background
483 #def_key "ctrl_l"
484 #  toggle_screen_lock
486 #def_key "`"
487 #  toggle_browser_sort_mode
489 #def_key "`"
490 #  toggle_library_tag_type
492 #def_key "`"
493 #  refetch_lyrics
495 #def_key "`"
496 #  add_random_items
498 #def_key "ctrl_p"
499 #  set_selected_items_priority
501 #def_key "q"
502 #  quit