pqiv icon indicating copy to clipboard operation
pqiv copied to clipboard

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

Open larsmagne opened this issue 9 months ago • 2 comments

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.

larsmagne avatar May 02 '24 09:05 larsmagne