Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 854 Bytes

README.md

File metadata and controls

21 lines (18 loc) · 854 Bytes

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: