Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e851f3144b
|
||
|
|
0bf4db0d92
|
||
|
|
3f17a7b632
|
No files matched your search
Generated
+1
-1
@@ -196,7 +196,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "mousefree"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"fontdue",
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "mousefree"
|
||||
version = "1.0.2"
|
||||
version = "1.0.4"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
description = "Keyboard-driven mouse navigation for Wayland"
|
||||
repository = "https://github.com/swaits/mousefree"
|
||||
homepage = "https://github.com/swaits/mousefree"
|
||||
repository = "https://git.swaits.com/swaits/mousefree"
|
||||
homepage = "https://git.swaits.com/swaits/mousefree"
|
||||
readme = "README.md"
|
||||
keywords = ["wayland", "keyboard", "mouse", "accessibility", "navigation"]
|
||||
categories = ["command-line-utilities", "accessibility"]
|
||||
|
||||
@@ -28,7 +28,7 @@ cargo install mousefree
|
||||
Or build from source:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/swaits/mousefree.git
|
||||
git clone https://git.swaits.com/swaits/mousefree.git
|
||||
cd mousefree
|
||||
cargo install --path .
|
||||
```
|
||||
|
||||
+15
-1
@@ -43,6 +43,8 @@ const MOD_ALT: u32 = 8;
|
||||
|
||||
// Drag animation timing.
|
||||
const DRAG_SETTLE_MS: u64 = 25;
|
||||
const DRAG_FOCUS_CLICK_HOLD_MS: u64 = 50;
|
||||
const DRAG_FOCUS_CLICK_PAUSE_MS: u64 = 500;
|
||||
const DRAG_PRESS_SETTLE_MS: u64 = 60;
|
||||
const DRAG_INTERP_STEPS: u32 = 12;
|
||||
const DRAG_STEP_DELAY_MS: u64 = 2;
|
||||
@@ -311,11 +313,23 @@ impl WaylandBackend {
|
||||
self.teardown_surface()?;
|
||||
let (sw, sh) = (self.state.screen_w, self.state.screen_h);
|
||||
|
||||
// 1. Move to the drag origin and let focus settle.
|
||||
// 1. Click at the drag origin to activate/focus the target window.
|
||||
// Without this, apps like zellij ignore the drag because the
|
||||
// surface isn't activated yet.
|
||||
self.send_motion(x1, y1, sw, sh)?;
|
||||
self.roundtrip("motion to drag start")?;
|
||||
sleep(Duration::from_millis(DRAG_SETTLE_MS));
|
||||
|
||||
self.send_button(BTN_LEFT, ButtonState::Pressed)?;
|
||||
self.roundtrip("focus click press")?;
|
||||
sleep(Duration::from_millis(DRAG_FOCUS_CLICK_HOLD_MS));
|
||||
self.send_button(BTN_LEFT, ButtonState::Released)?;
|
||||
self.roundtrip("focus click release")?;
|
||||
|
||||
// Wait past the double-click window so the focus click and the
|
||||
// upcoming press-and-hold are never interpreted as a double-click.
|
||||
sleep(Duration::from_millis(DRAG_FOCUS_CLICK_PAUSE_MS));
|
||||
|
||||
// 2. Press and hold — give the app time to register the press.
|
||||
self.send_button(BTN_LEFT, ButtonState::Pressed)?;
|
||||
self.roundtrip("press at drag start")?;
|
||||
|
||||
Reference in new issue
Block a user