From 12efa0e3b429675047cb2900d49e1f38afeb650b Mon Sep 17 00:00:00 2001 From: Arthur Williams Date: Sat, 18 Sep 2021 12:27:12 -0700 Subject: Add ability to bind arbitrary functions. Before all the predated commands where kept in an array and their indexes were used in bindings. This meant that users couldn't add their own functions from the config file. Now key/mouse bindings have been changed to to store the function ptr (wrapped in a cmd_t struct to also store the mode) directly instead. General cleanup done in this commit: Defined `MODE_ALL` instead of using magic number. For example, suppose one had bindings like: { 0, XK_q, g_quit, None }, { ShitMask, XK_q, {quit_err}, None } { ControlMask, XK_q, {quit_err, .mode=MODE_IMAGE}, None } The existing binding `q` has been left unchanged and is defined the same way. However, the new hypothetical binding `Shift-q` can be used to call the custom function quit_err in any mode (default). `Ctrl-q` on the other hand will be called only on image mode. Closes #50 --- commands.lst | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 commands.lst (limited to 'commands.lst') diff --git a/commands.lst b/commands.lst deleted file mode 100644 index a97ca1c..0000000 --- a/commands.lst +++ /dev/null @@ -1,36 +0,0 @@ -G_CMD(quit) -G_CMD(switch_mode) -G_CMD(toggle_fullscreen) -G_CMD(toggle_bar) -G_CMD(prefix_external) -G_CMD(reload_image) -G_CMD(remove_image) -G_CMD(first) -G_CMD(n_or_last) -G_CMD(scroll_screen) -G_CMD(zoom) -G_CMD(toggle_image_mark) -G_CMD(reverse_marks) -G_CMD(mark_range) -G_CMD(unmark_all) -G_CMD(navigate_marked) -G_CMD(change_gamma) - -I_CMD(navigate) -I_CMD(cursor_navigate) -I_CMD(alternate) -I_CMD(navigate_frame) -I_CMD(toggle_animation) -I_CMD(scroll) -I_CMD(scroll_to_edge) -I_CMD(drag) -I_CMD(set_zoom) -I_CMD(fit_to_win) -I_CMD(rotate) -I_CMD(flip) -I_CMD(toggle_antialias) -I_CMD(toggle_alpha) -I_CMD(slideshow) - -T_CMD(move_sel) -T_CMD(reload_all) -- cgit v1.2.3-54-g00ecf