summaryrefslogtreecommitdiffstats
path: root/config.def.h
diff options
context:
space:
mode:
authorN-R-K <79544946+N-R-K@users.noreply.github.com>2022-01-10 17:52:06 +0100
committerGitHub <noreply@github.com>2022-01-10 17:52:06 +0100
commit7a75c42b37b08f44c72f9a7c98eb6076967470fb (patch)
tree9171a7929d43cb2a6d72703374970ac7e60c9509 /config.def.h
parent157cda5b31d51ea1379d907489fa982bcba36f44 (diff)
downloadnsxiv-7a75c42b37b08f44c72f9a7c98eb6076967470fb.tar.zst
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
Diffstat (limited to 'config.def.h')
-rw-r--r--config.def.h13
1 files changed, 12 insertions, 1 deletions
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, */