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

Support for mouse position/hover #18

Closed
RAMAMario opened this issue Jul 27, 2020 · 3 comments
Closed

Support for mouse position/hover #18

RAMAMario opened this issue Jul 27, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@RAMAMario
Copy link
Contributor

I stumbled upon the use-case where I need to check the correct behavior of the app under test when using mouse hover over an element (i.e. tooltips).
Is this planned and/or something of interest if I would implement it for my team?

@faaxm
Copy link
Owner

faaxm commented Aug 4, 2020

Actually a bigger update is planned for the mouse commands, as they currently also only support clicking in the middle of an object and don't support any other positioning. I am not yet sure as to how I would like the API for this to look in the end and I think it needs some more planning to work for the different use cases.

If you want to go ahead with your implementation, one thing to look out for is that QtQuick can sometimes be a bit "slow" in detecting the mouse cursor. E.g. I found that just moving the mouse onto an object is not always detected, but once you move the cursor around within an object, it does get detected.
However, if you use the existing calls in scene/Qt/QtEvents, this is already accounted for in

// Wiggle the cursor a bit. This is needed to correctly recognize drag events

As a general rule, I like having separate Command classes defined for these types of things rather than reusing the GenericCommand with lambdas. So something like a new MoveMouse command would match the current design.

@RAMAMario
Copy link
Contributor Author

Thanks for the feedback. I have no immediate need (and allocated time), so I will not do anything anytime soon. Even more so, if you plan something bigger anyway.

@faaxm faaxm added the enhancement New feature or request label Aug 28, 2020
@faaxm faaxm mentioned this issue Sep 6, 2020
@faaxm
Copy link
Owner

faaxm commented Jul 20, 2021

Will close this issue, since this can be done with PyAutoGUI and system events now and I don't see a way to simulate a double-click purely by posting the right QEvent, which is how the non-PyAutoGUI part of Spix works.

@faaxm faaxm closed this as completed Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants