Compare commits

..

1 Commits

Author SHA1 Message Date
Ferdinand Schober
151dd1100b remaining feature flags 2026-05-22 09:26:31 +02:00
11 changed files with 33 additions and 68 deletions

View File

@@ -174,16 +174,13 @@ jobs:
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
- name: Get short SHA
id: vars
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
- name: Create Pre-Release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ format('{0}-{1}', github.event.inputs.name || github.ref_name, steps.vars.outputs.short_sha) }}
name: ${{ format('{0}-{1}', github.event.inputs.name || github.ref_name, steps.vars.outputs.short_sha) }}
tag_name: ${{ github.event.inputs.name || github.ref_name }}
name: ${{ github.event.inputs.name || github.ref_name }}
prerelease: true
generate_release_notes: true
files: |

16
Cargo.lock generated
View File

@@ -1647,7 +1647,7 @@ dependencies = [
[[package]]
name = "input-capture"
version = "0.4.0"
version = "0.3.0"
dependencies = [
"ashpd",
"async-trait",
@@ -1677,7 +1677,7 @@ dependencies = [
[[package]]
name = "input-emulation"
version = "0.4.0"
version = "0.3.0"
dependencies = [
"ashpd",
"async-trait",
@@ -1703,7 +1703,7 @@ dependencies = [
[[package]]
name = "input-event"
version = "0.4.0"
version = "0.3.0"
dependencies = [
"futures-core",
"log",
@@ -1840,7 +1840,7 @@ dependencies = [
[[package]]
name = "lan-mouse"
version = "0.11.0"
version = "0.10.0"
dependencies = [
"clap",
"env_logger",
@@ -1875,7 +1875,7 @@ dependencies = [
[[package]]
name = "lan-mouse-cli"
version = "0.3.0"
version = "0.2.0"
dependencies = [
"clap",
"futures",
@@ -1886,7 +1886,7 @@ dependencies = [
[[package]]
name = "lan-mouse-gtk"
version = "0.3.0"
version = "0.2.0"
dependencies = [
"async-channel",
"glib-build-tools",
@@ -1900,7 +1900,7 @@ dependencies = [
[[package]]
name = "lan-mouse-ipc"
version = "0.3.0"
version = "0.2.0"
dependencies = [
"futures",
"log",
@@ -1913,7 +1913,7 @@ dependencies = [
[[package]]
name = "lan-mouse-proto"
version = "0.3.0"
version = "0.2.0"
dependencies = [
"input-event",
"num_enum",

View File

@@ -12,7 +12,7 @@ members = [
[package]
name = "lan-mouse"
description = "Software KVM Switch / mouse & keyboard sharing software for Local Area Networks"
version = "0.11.0"
version = "0.10.0"
edition = "2021"
license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse"
@@ -27,13 +27,13 @@ panic = "abort"
shadow-rs = "1.2.0"
[dependencies]
input-event = { path = "input-event", version = "0.4.0" }
input-emulation = { path = "input-emulation", version = "0.4.0", default-features = false }
input-capture = { path = "input-capture", version = "0.4.0", default-features = false }
lan-mouse-cli = { path = "lan-mouse-cli", version = "0.3.0" }
lan-mouse-gtk = { path = "lan-mouse-gtk", version = "0.3.0", optional = true }
lan-mouse-ipc = { path = "lan-mouse-ipc", version = "0.3.0" }
lan-mouse-proto = { path = "lan-mouse-proto", version = "0.3.0" }
input-event = { path = "input-event", version = "0.3.0" }
input-emulation = { path = "input-emulation", version = "0.3.0", default-features = false }
input-capture = { path = "input-capture", version = "0.3.0", default-features = false }
lan-mouse-cli = { path = "lan-mouse-cli", version = "0.2.0" }
lan-mouse-gtk = { path = "lan-mouse-gtk", version = "0.2.0", optional = true }
lan-mouse-ipc = { path = "lan-mouse-ipc", version = "0.2.0" }
lan-mouse-proto = { path = "lan-mouse-proto", version = "0.2.0" }
shadow-rs = { version = "1.2.0", features = ["metadata"] }
hickory-resolver = "0.25.2"

View File

@@ -1,7 +1,7 @@
[package]
name = "input-capture"
description = "cross-platform input-capture library used by lan-mouse"
version = "0.4.0"
version = "0.3.0"
edition = "2021"
license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse"
@@ -10,7 +10,7 @@ repository = "https://github.com/feschber/lan-mouse"
futures = "0.3.28"
futures-core = "0.3.30"
log = "0.4.22"
input-event = { path = "../input-event", version = "0.4.0" }
input-event = { path = "../input-event", version = "0.3.0" }
memmap = "0.7"
tempfile = "3.25.0"
thiserror = "2.0.0"

View File

@@ -1,7 +1,7 @@
[package]
name = "input-emulation"
description = "cross-platform input emulation library used by lan-mouse"
version = "0.4.0"
version = "0.3.0"
edition = "2021"
license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse"
@@ -10,7 +10,7 @@ repository = "https://github.com/feschber/lan-mouse"
async-trait = "0.1.80"
futures = "0.3.28"
log = "0.4.22"
input-event = { path = "../input-event", version = "0.4.0" }
input-event = { path = "../input-event", version = "0.3.0" }
thiserror = "2.0.0"
tokio = { version = "1.32.0", features = [
"io-util",

View File

@@ -106,19 +106,8 @@ impl MacOSEmulation {
}
}
}
// Always release the key with the correct CGKeyCode, regardless of
// whether the repeat loop ran. This matches @feschber's review
// request: "still release the key repeat task but with the correct
// code."
//
// Do NOT call update_modifiers here: `key` is a Mac CGKeyCode but
// update_modifiers expects a Linux evdev scancode, and the two
// codespaces collide (e.g. Mac LeftShift=56 == Linux KeyLeftAlt=56,
// Mac Down=125 == Linux KeyLeftMeta=125), corrupting modifier
// state for chords like Shift+Option+X or Cmd+Down. Modifier state
// is owned by the main consume() loop, which already calls
// update_modifiers with the correct Linux scancode on the real key
// release event from the client.
// release key when cancelled
update_modifiers(&modifiers, key as u32, 0);
key_event(event_source.clone(), key, 0, modifiers.get());
});
self.repeat_task = Some(repeat_task);
@@ -168,19 +157,6 @@ extern "C" {
fn AXIsProcessTrusted() -> bool;
}
/// Mac virtual key codes for the four arrow keys.
const MAC_KEY_LEFT: u16 = 0x7B;
const MAC_KEY_RIGHT: u16 = 0x7C;
const MAC_KEY_DOWN: u16 = 0x7D;
const MAC_KEY_UP: u16 = 0x7E;
fn is_arrow_key(key: u16) -> bool {
matches!(
key,
MAC_KEY_LEFT | MAC_KEY_RIGHT | MAC_KEY_DOWN | MAC_KEY_UP
)
}
fn key_event(event_source: CGEventSource, key: u16, state: u8, modifiers: XMods) {
let event = match CGEvent::new_keyboard_event(event_source, key, state != 0) {
Ok(e) => e,
@@ -189,15 +165,7 @@ fn key_event(event_source: CGEventSource, key: u16, state: u8, modifiers: XMods)
return;
}
};
let mut flags = to_cgevent_flags(modifiers);
// Hardware-generated arrow keys on macOS carry NumericPad + SecondaryFn.
// CGEventTap-based hotkey matchers (e.g. tiling window managers) check
// these flags to recognize navigation keys; without them synthesized
// arrow chords fall through to the focused app.
if is_arrow_key(key) {
flags |= CGEventFlags::CGEventFlagNumericPad | CGEventFlags::CGEventFlagSecondaryFn;
}
event.set_flags(flags);
event.set_flags(to_cgevent_flags(modifiers));
event.post(CGEventTapLocation::HID);
log::trace!("key event: {key} {state}");
}

View File

@@ -1,7 +1,7 @@
[package]
name = "input-event"
description = "cross-platform input-event types for input-capture / input-emulation"
version = "0.4.0"
version = "0.3.0"
edition = "2021"
license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse"

View File

@@ -1,14 +1,14 @@
[package]
name = "lan-mouse-cli"
description = "CLI Frontend for lan-mouse"
version = "0.3.0"
version = "0.2.0"
edition = "2021"
license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse"
[dependencies]
futures = "0.3.30"
lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.3.0" }
lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.2.0" }
clap = { version = "4.4.11", features = ["derive"] }
thiserror = "2.0.0"
tokio = { version = "1.32.0", features = [

View File

@@ -1,7 +1,7 @@
[package]
name = "lan-mouse-gtk"
description = "GTK4 / Libadwaita Frontend for lan-mouse"
version = "0.3.0"
version = "0.2.0"
edition = "2021"
license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse"
@@ -12,7 +12,7 @@ adw = { package = "libadwaita", version = "0.7.0", features = ["v1_1"] }
async-channel = { version = "2.1.1" }
hostname = "0.4.0"
log = "0.4.20"
lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.3.0" }
lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.2.0" }
thiserror = "2.0.0"
[build-dependencies]

View File

@@ -1,7 +1,7 @@
[package]
name = "lan-mouse-ipc"
description = "library for communication between lan-mouse service and frontends"
version = "0.3.0"
version = "0.2.0"
edition = "2021"
license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse"

View File

@@ -1,7 +1,7 @@
[package]
name = "lan-mouse-proto"
description = "network protocol for lan-mouse"
version = "0.3.0"
version = "0.2.0"
edition = "2021"
license = "GPL-3.0-or-later"
repository = "https://github.com/feschber/lan-mouse"
@@ -9,5 +9,5 @@ repository = "https://github.com/feschber/lan-mouse"
[dependencies]
num_enum = "0.7.2"
thiserror = "2.0.0"
input-event = { path = "../input-event", version = "0.4.0" }
input-event = { path = "../input-event", version = "0.3.0" }
paste = "1.0"