phillipberndt / pqiv

Powerful image viewer with minimal UI
http://www.pberndt.com/Programme/Linux/pqiv/index.html
GNU General Public License v3.0
307 stars 44 forks source link

Feature request: Add a command line option to ignore input events? #238

Open larsmagne opened 5 months ago

larsmagne commented 5 months ago

Hi,

this is an enhancement request, I guess -- I wonder if you'd be open to receving a patch to add a new option like --ignore-events to pqiv?

Some background: My use case is implementing a simple touchscreen interface, where the user taps boxes in a grid to have some action happen. I'm using pqiv to display an overlay (with a transparent background) as a "help guide" to show where the active areas of the screen are.

pqiv is impressively fast and convenient for this use case, but it has two problems:

In window_motion_notify_callback pqiv reacts to mouse "drags" by moving the image, and this is triggered on a touchscreen. So I'd like to have a --ignore-events=mouse switch to disable the code that starts with:

    if(event->state & GDK_BUTTON1_MASK) {
            if(application_mode == DEFAULT) {
                            current_shift_x += dev_x;                         
                            current_shift_y += dev_y;                         
                    }
        }

And also the mouse-related code in handle_input_event, I guess.

Similarly, spurious keystrokes can be generated, so a --ignore-events=keyboard to disable the keyboard code in handle_input_event.

And then --ignore-events=all to ignore all events.

Now, I know my use case is niche, so you may want to pass on such a feature, but if this sounds OK to you, I can whip up a patch and submit a pull request. Let me know either way.

VMaksim commented 2 days ago

Hi This would be a very good option. I need to ignore some events, mouse events and keyboard events (except for the keys specified in the config (section [keybindings]))

larsmagne commented 1 day ago

That sounds useful... but is more complicated than what I had in mind. Hm...