mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-24 13:40:55 +03:00
fix double release
This commit is contained in:
@@ -167,6 +167,7 @@ impl InputCapture {
|
||||
|
||||
/// release mouse
|
||||
pub async fn release(&mut self) -> Result<(), CaptureError> {
|
||||
log::info!("RELEASE CAPTURE");
|
||||
self.pressed_keys.clear();
|
||||
self.capture.release().await
|
||||
}
|
||||
|
||||
@@ -477,10 +477,10 @@ async fn release_capture<'a>(
|
||||
log::debug!("client entered @ ({x}, {y})");
|
||||
let (dx, dy) = match current_pos {
|
||||
// offset cursor position to not enter again immediately
|
||||
Position::Left => (1., 0.),
|
||||
Position::Right => (-1., 0.),
|
||||
Position::Top => (0., 1.),
|
||||
Position::Bottom => (0., -1.),
|
||||
Position::Left => (10., 0.),
|
||||
Position::Right => (-10., 0.),
|
||||
Position::Top => (0., 10.),
|
||||
Position::Bottom => (0., -10.),
|
||||
};
|
||||
// release 1px to the right of the entered zone
|
||||
let cursor_position = (x as f64 + dx, y as f64 + dy);
|
||||
|
||||
Reference in New Issue
Block a user