Add support for fetching lyrics in background for selected songs
[ncmpcpp.git] / doc / bindings
blob468f5ad3b3c6f4b318efafaa257afa2be186ea58
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: while command chains are executed, internal environment
118 ##    update (which includes current window refresh and mpd status
119 ##    update) is not performed for performance reasons. However, it
120 ##    may be desirable to do so in some situration. Therefore it's
121 ##    possible to invoke by hand by performing 'update enviroment'
122 ##    action.
124 ## Note: There is a difference between:
126 ##         def_key "key"
127 ##           action1
129 ##         def_key "key"
130 ##           action2
132 ##       and
134 ##         def_key "key"
135 ##           action1
136 ##           action2
138 ##      First one binds two single actions to the same key whilst
139 ##      second one defines a chain of actions. The behavior of
140 ##      these two is different and is described in (1) and (2).
142 ## Note: Function def_key accepts non-ascii characters.
144 ##### List of unbound actions #####
146 ## The following actions are not bound to any key/command:
148 ##  - set_volume
151 #def_key "mouse"
152 #  mouse_event
154 #def_key "up"
155 #  scroll_up
157 #def_key "shift-up"
158 #  select_item
159 #  scroll_up
161 #def_key "down"
162 #  scroll_down
164 #def_key "shift-down"
165 #  select_item
166 #  scroll_down
168 #def_key "["
169 #  scroll_up_album
171 #def_key "]"
172 #  scroll_down_album
174 #def_key "{"
175 #  scroll_up_artist
177 #def_key "}"
178 #  scroll_down_artist
180 #def_key "page_up"
181 #  page_up
183 #def_key "page_down"
184 #  page_down
186 #def_key "home"
187 #  move_home
189 #def_key "end"
190 #  move_end
192 #def_key "insert"
193 #  select_item
195 #def_key "enter"
196 #  enter_directory
198 #def_key "enter"
199 #  toggle_output
201 #def_key "enter"
202 #  run_action
204 #def_key "enter"
205 #  play_item
207 #def_key "space"
208 #  add_item_to_playlist
210 #def_key "space"
211 #  toggle_lyrics_update_on_song_change
213 #def_key "space"
214 #  toggle_visualization_type
216 #def_key "delete"
217 #  delete_playlist_items
219 #def_key "delete"
220 #  delete_browser_items
222 #def_key "delete"
223 #  delete_stored_playlist
225 #def_key "right"
226 #  next_column
228 #def_key "right"
229 #  slave_screen
231 #def_key "right"
232 #  volume_up
234 #def_key "+"
235 #  volume_up
237 #def_key "left"
238 #  previous_column
240 #def_key "left"
241 #  master_screen
243 #def_key "left"
244 #  volume_down
246 #def_key "-"
247 #  volume_down
249 #def_key ":"
250 #  execute_command
252 #def_key "tab"
253 #  next_screen
255 #def_key "shift-tab"
256 #  previous_screen
258 #def_key "f1"
259 #  show_help
261 #def_key "1"
262 #  show_playlist
264 #def_key "2"
265 #  show_browser
267 #def_key "2"
268 #  change_browse_mode
270 #def_key "3"
271 #  show_search_engine
273 #def_key "3"
274 #  reset_search_engine
276 #def_key "4"
277 #  show_media_library
279 #def_key "4"
280 #  toggle_media_library_columns_mode
282 #def_key "5"
283 #  show_playlist_editor
285 #def_key "6"
286 #  show_tag_editor
288 #def_key "7"
289 #  show_outputs
291 #def_key "8"
292 #  show_visualizer
294 #def_key "="
295 #  show_clock
297 #def_key "@"
298 #  show_server_info
300 #def_key "s"
301 #  stop
303 #def_key "p"
304 #  pause
306 #def_key ">"
307 #  next
309 #def_key "<"
310 #  previous
312 #def_key "ctrl-h"
313 #  jump_to_parent_directory
315 #def_key "ctrl-h"
316 #  replay_song
318 #def_key "backspace"
319 #  jump_to_parent_directory
321 #def_key "backspace"
322 #  replay_song
324 #def_key "f"
325 #  seek_forward
327 #def_key "b"
328 #  seek_backward
330 #def_key "r"
331 #  toggle_repeat
333 #def_key "z"
334 #  toggle_random
336 #def_key "y"
337 #  save_tag_changes
339 #def_key "y"
340 #  start_searching
342 #def_key "y"
343 #  toggle_single
345 #def_key "R"
346 #  toggle_consume
348 #def_key "Y"
349 #  toggle_replay_gain_mode
351 #def_key "T"
352 #  toggle_add_mode
354 #def_key "|"
355 #  toggle_mouse
357 #def_key "#"
358 #  toggle_bitrate_visibility
360 #def_key "Z"
361 #  shuffle
363 #def_key "x"
364 #  toggle_crossfade
366 #def_key "X"
367 #  set_crossfade
369 #def_key "u"
370 #  update_database
372 #def_key "ctrl-s"
373 #  sort_playlist
375 #def_key "ctrl-s"
376 #  toggle_browser_sort_mode
378 #def_key "ctrl-s"
379 #  toggle_media_library_sort_mode
381 #def_key "ctrl-r"
382 #  reverse_playlist
384 #def_key "ctrl-f"
385 #  apply_filter
387 #def_key "ctrl-_"
388 #  select_found_items
390 #def_key "/"
391 #  find
393 #def_key "/"
394 #  find_item_forward
396 #def_key "?"
397 #  find
399 #def_key "?"
400 #  find_item_backward
402 #def_key "."
403 #  next_found_item
405 #def_key ","
406 #  previous_found_item
408 #def_key "w"
409 #  toggle_find_mode
411 #def_key "e"
412 #  edit_song
414 #def_key "e"
415 #  edit_library_tag
417 #def_key "e"
418 #  edit_library_album
420 #def_key "e"
421 #  edit_directory_name
423 #def_key "e"
424 #  edit_playlist_name
426 #def_key "e"
427 #  edit_lyrics
429 #def_key "i"
430 #  show_song_info
432 #def_key "I"
433 #  show_artist_info
435 #def_key "g"
436 #  jump_to_position_in_song
438 #def_key "l"
439 #  show_lyrics
441 #def_key "ctrl-v"
442 #  select_range
444 #def_key "v"
445 #  reverse_selection
447 #def_key "V"
448 #  remove_selection
450 #def_key "B"
451 #  select_album
453 #def_key "a"
454 #  add_selected_items
456 #def_key "c"
457 #  clear_playlist
459 #def_key "c"
460 #  clear_main_playlist
462 #def_key "C"
463 #  crop_playlist
465 #def_key "C"
466 #  crop_main_playlist
468 #def_key "m"
469 #  move_sort_order_up
471 #def_key "m"
472 #  move_selected_items_up
474 #def_key "m"
475 #  set_visualizer_sample_multiplier
477 #def_key "n"
478 #  move_sort_order_down
480 #def_key "n"
481 #  move_selected_items_down
483 #def_key "M"
484 #  move_selected_items_to
486 #def_key "A"
487 #  add
489 #def_key "S"
490 #  save_playlist
492 #def_key "o"
493 #  jump_to_playing_song
495 #def_key "G"
496 #  jump_to_browser
498 #def_key "G"
499 #  jump_to_playlist_editor
501 #def_key "~"
502 #  jump_to_media_library
504 #def_key "E"
505 #  jump_to_tag_editor
507 #def_key "U"
508 #  toggle_playing_song_centering
510 #def_key "P"
511 #  toggle_display_mode
513 #def_key "\\"
514 #  toggle_interface
516 #def_key "!"
517 #  toggle_separators_between_albums
519 #def_key "L"
520 #  toggle_lyrics_fetcher
522 #def_key "F"
523 #  fetch_lyrics_in_background
525 #def_key "alt-l"
526 #  toggle_fetching_lyrics_in_background
528 #def_key "ctrl-l"
529 #  toggle_screen_lock
531 #def_key "`"
532 #  toggle_library_tag_type
534 #def_key "`"
535 #  refetch_lyrics
537 #def_key "`"
538 #  add_random_items
540 #def_key "ctrl-p"
541 #  set_selected_items_priority
543 #def_key "q"
544 #  quit