Repository

Cross-Platform Get/Set Mouse Position in V

Get and set the mouse position like so:

import mouse

fn main() {
    x, y := mouse.get_pos()
    println('Mouse is at: X: ${x}, Y: ${y}')

    // center the mouse in the middle of the screen
    sz := mouse.screen_size()
    mouse.set_pos(sz.width / 2, sz.height / 2)
}

TODO

Contributions for MacOS support would be most appreciated. I don't have access to a MacOS device, so I'm unable to do this myself. I believe these links will help whoever decides to contribute:

About

Cross platform get and set mouse position.

0
10
last Aug 12

Author

islonely