Skip to content

Getting mouse position without listening to an event. #177

@LightCannon

Description

@LightCannon

Hello. First, I would like to thank you for this library

Second, I'm trying to do some logic with moving mouse in my Qt app. Basically, I want to move the mouse and send clicks/releases based on my logic (I'm going to control another apps from my app).

Here are the cross platform ways I can think of with what blocks me:
1- Use Qt's QCursor.setPos which moves mouse and listen to mouse events using your library. I'm storing x and y of mouse move to track the mouse so when I send press/release event the library can use the tracked x and y to press at this location.

problem: QCursor.setPos does not trigger any mouse move event. This solution would have been ideal if this was not happening.

2- Same as 1 but instead QCursor.setPos, I will use your library to send mouse press/releases
problem: coordinates are not dpi aware, and has problems when multiple monitors are connected.

3- Find some way to get the mouse position without listening to event, and I will use that in the event when I press.
problem: I do not know how to do so.

What is the right solution for this based on your library? Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions