From 7a75c42b37b08f44c72f9a7c98eb6076967470fb Mon Sep 17 00:00:00 2001 From: N-R-K <79544946+N-R-K@users.noreply.github.com> Date: Mon, 10 Jan 2022 16:52:06 +0000 Subject: make thumbnail bindings configureable via config.h (#167) this allows for configuring thumbnail mode mouse bindings similar to image mode bindings. however we can't put the thumbnails bindings into the existing buttons[] array due to fallthrough. For example M3 would switch mode and then end up selecting an image. which is why thumbnail bindings have been put into it's own array `buttons_tns[]` and `buttons[]` has been renamed to `buttons_img[]` for consistency. Closes: https://github.com/nsxiv/nsxiv/issues/131 --- config.def.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'config.def.h') diff --git a/config.def.h b/config.def.h index 6e4b942..b328305 100644 --- a/config.def.h +++ b/config.def.h @@ -175,7 +175,7 @@ static const keymap_t keys[] = { }; /* mouse button mappings for image mode: */ -static const button_t buttons[] = { +static const button_t buttons_img[] = { /* modifiers button function argument */ { 0, 1, i_cursor_navigate, None }, { ControlMask, 1, i_drag, DRAG_RELATIVE }, @@ -185,6 +185,17 @@ static const button_t buttons[] = { { 0, 5, g_zoom, -1 }, }; +/* mouse button mappings for thumbnail mode: */ +static const button_t buttons_tns[] = { + /* modifiers button function argument */ + { 0, 1, t_select, None }, + { 0, 3, t_drag_mark_image, None }, + { 0, 4, t_scroll, DIR_UP }, + { 0, 5, t_scroll, DIR_DOWN }, + { ControlMask, 4, g_scroll_screen, DIR_UP }, + { ControlMask, 5, g_scroll_screen, DIR_DOWN }, +}; + /* true means NAV_WIDTH is relative (33%), false means absolute (33 pixels) */ static const bool NAV_IS_REL = true; /* width of navigation area, 0 disables cursor navigation, */ -- cgit v1.2.3