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

Suppress mouse move not working when using parsec #584

Closed
kimkun07 opened this issue Jan 26, 2024 · 1 comment
Closed

Suppress mouse move not working when using parsec #584

kimkun07 opened this issue Jan 26, 2024 · 1 comment

Comments

@kimkun07
Copy link

Description
When listening sequence of mouse input with suppress option, mouse position is fixed to first click.

Output of running To Reproduce script:

click (1164, 291, <Button.left: (4, 2, 0)>, True)
click (1164, 291, <Button.left: (4, 2, 0)>, False)
click (1164, 291, <Button.left: (4, 2, 0)>, True)
click (1164, 291, <Button.left: (4, 2, 0)>, False)
click (1164, 291, <Button.left: (4, 2, 0)>, True)
click (1164, 291, <Button.left: (4, 2, 0)>, False)

I was constantly moving my mouse and clicking.
However, the position found in on_click method is not moving.

If I disable suppress option, I get desired output. (Position changing)

click (806, 477, <Button.left: (4, 2, 0)>, True)
click (806, 477, <Button.left: (4, 2, 0)>, False)
click (1431, 211, <Button.left: (4, 2, 0)>, True)
click (1431, 211, <Button.left: (4, 2, 0)>, False)
click (1451, 517, <Button.left: (4, 2, 0)>, True)
click (1451, 517, <Button.left: (4, 2, 0)>, False)

Is this expected behavior? How can I get sequence of input while suppressing the event?

Platform and pynput version
OS: Windows 11 22H2
Python: 3.12.1
pynput: 1.7.6

To Reproduce

import time
from pynput import mouse

def on_click(*args):
    print("click", args)

with mouse.Listener(on_click=on_click, suppress=True):
    time.sleep(5)
@kimkun07
Copy link
Author

My mistake: I found out suppress was intended to not pass both click and move event to system.

Problem with Parsec
I was using parsec (a remote desktop program), and it was the reason for my mistake.
It appears that when using Parsec, mouse move event is not suppressed correctly, while mouse click event is suppressed correctly.
As a result, I could still move my mouse even with the suppress option enabled, which should not have been the case.

@kimkun07 kimkun07 changed the title mouse position is not correct when suppress=True Suppress mouse move not working when using parsec Jan 27, 2024
@kimkun07 kimkun07 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2024
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

1 participant