Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Allow rebinding mouse buttons/scrollwheel #175

Open
DarkDefender opened this issue Aug 23, 2019 · 3 comments
Open

Allow rebinding mouse buttons/scrollwheel #175

DarkDefender opened this issue Aug 23, 2019 · 3 comments
Labels
Feature New feature request
Milestone

Comments

@DarkDefender
Copy link
Contributor

I'm currently using a very hacky patch to rebind the scroll wheel to move:

diff --git a/src/imv.c b/src/imv.c
index 24054da..5631c70 100644
--- a/src/imv.c
+++ b/src/imv.c
@@ -1151,7 +1151,8 @@ static void handle_event(struct imv *imv, SDL_Event *event)
       }
       break;
     case SDL_MOUSEWHEEL:
-      imv_viewport_zoom(imv->view, imv->image, IMV_ZOOM_MOUSE, event->wheel.y);
+      //imv_viewport_zoom(imv->view, imv->image, IMV_ZOOM_MOUSE, event->wheel.y);
+      imv_viewport_move(imv->view, event->wheel.x * 20, event->wheel.y * 20, imv->image);
       SDL_ShowCursor(SDL_ENABLE);
       break;
     case SDL_MOUSEMOTION:

However this is not a good solution. I think the best would be to be able to rebind mouse events to different actions.

@eXeC64
Copy link
Owner

eXeC64 commented Aug 24, 2019

Hmm, given how few ways people will probably want to use scroll events and how important getting the right feel for them is, I think this should probably be a couple of config options rather than binding discrete actions to a command.

e.g.

[options]
mouse_scroll_action = <pan|zoom>
mouse_scroll_speed = <floating point value controlling zoom/pan speed.>
mouse_scroll_reverse_y = <bool>

Does that seem reasonable, or is being able to bind scroll_down to executing a command really important? I think I'd prefer to have really smooth natural zooming/panning rather than binding scroll to discrete actions.

@DarkDefender
Copy link
Contributor Author

This does seem more reasonable to me! :)

I also think people would prefer smooth scrolling over binding the events to operators.

@eXeC64 eXeC64 added the Feature New feature request label Aug 24, 2019
@eXeC64 eXeC64 added this to the 4.1.0 milestone Aug 25, 2019
@Arnaudv6
Copy link

probably more related to #211, but can you please consider
prev/next image on mouse wheel?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature New feature request
Projects
None yet
Development

No branches or pull requests

3 participants