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 1 year ago • 3 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

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]))

VMaksim avatar Oct 04 '24 13:10 VMaksim

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

larsmagne avatar Oct 05 '24 14:10 larsmagne

Sounds like there is some overlap with #246, which is about implementing a way to reset all bindings and start from scratch - the only thing extra here is that the mouse cursor is also in scope for this issue.

phillipberndt avatar Oct 31 '24 08:10 phillipberndt