hellosiyan / Viewnior

Elegant Image Viewer
https://siyanpanayotov.com/project/viewnior/
GNU General Public License v3.0
320 stars 54 forks source link

Undocumented response to mouse button 9 is bad. #56

Closed Lew-Rockwell-Fan closed 2 years ago

Lew-Rockwell-Fan commented 5 years ago

Viewnior responds to button 9 on a Logitech M-570 trackball by changing to the next image, as if it were a scroll down. This makes it impractical to use button 9 for other purposes. Is there any way to stop it from doing that? It doesn't seem to be documented.

Lew-Rockwell-Fan commented 3 years ago

I have found a partial work-around for Openbox users. You can bind button 9 click in the frame context and the click will not be passed on to the application. ANY application. This only works for frame, no other contexts, and precludes additional binding of the same mouse action to any other context, like titlebar or client, so you won't be able to make any distinctions based on what part of the window is clicked. The binding will be effective for ALL windows, not just viewnior.

hellosiyan commented 2 years ago

@Lew-Rockwell-Fan What is button 9 and how does it work in other apps/environments? Is the mapping to "next image" wrong, or do you just want to customize it?

Lew-Rockwell-Fan commented 2 years ago

"What is button 9" Button 9 is whatever control on a pointing input device, such as a mouse or trackball, xev calls button 9. The standard left, right, middle, up, and down, are buttons 1 - 5. In the case of the Logitech M-570 trackball it is one of the buttons to the left of the standard cluster. "how does it work in other apps" Almost universally, it is ignored. Viewnior is the only exception I know of. The common view is that buttons > 5 are for users to assign custom functions to. Obviously, you can't count on a user to have a button 9, so if you bind it to any basic function, it is redundant with whatever means a user with a standard mouse would use. Therefore it doesn't make a lot of sense to assign it a function at all since that adds no functionality and interferes with the NORMAL function of invoking a custom action.

hellosiyan commented 2 years ago

@Lew-Rockwell-Fan Thanks for the detailed explanation. Buttons 8 and 9 correspond to the next/prev buttons on the mice I tested. I tried the same buttons in Eye of Gnome and they do as advertise - change to the next/previous image. So all seems good to me :thinking:

If you would like to disable this behavior, you can comment out the mapping of buttons 8 and 9, which is to be found here: https://github.com/hellosiyan/Viewnior/blob/1d020c1/src/uni-image-view.c#L603