Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
larsmagne opened this issue May 2, 2024 · 3 comments
Open

Comments

@larsmagne
Copy link

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
Copy link

VMaksim commented Oct 4, 2024

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
Copy link
Author

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

@phillipberndt
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants