AltF02 / AltF02/mouse-rs

Windows scaling also scales mouse-rs locations

Aperta
#12 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
125
Fork
8
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I was going mad at how the pointer location was inaccurate before I figured this out: windows scaling options also scales the mouse location when using move_to().
![image](https://user-images.githubusercontent.com/16920817/169707050-ed3cd15c-b370-4496-948c-0ea73b9b767e.png)
Despite my monitor being 1920x1080, move_to() is also scaled by 125%, meaning I reach the bottom right corner of the screen at move_to(1536, 864)

I realize this project hasn't been updated in a year but this is probably unintentional and I hope someone can get around to fixing it.

Worth noting it's not a _huge_ deal if you know the current scale, but the problem is if I'm giving the program to someone else.

```rust
let mouse = Mouse::new();
let loc_x = (f64::from(INTENDED_X) / 1.25).floor() as i32; // Assuming you're at 125% scale.
let loc_y = (f64::from(INTENDED_Y) / 1.25).floor() as i32; // Not 100% accurate because it has to be i32, so I have to floor or get average.
mouse.move_to(loc_x, loc_y);
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.