LiveSplit / livesplit-core

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.
https://livesplit.org/
Apache License 2.0
209 stars 56 forks source link

Only modifier keys get registered on MacOS #778

Closed M1KUS3Q closed 4 months ago

M1KUS3Q commented 4 months ago

When running this code on mac (with both accessibility and input monitoring enabled for terminal and Vscode, where I am running the program):

    let hook = Hook::new().unwrap();
    hook.register(
        Hotkey {
            key_code: KeyCode::KeyP,
            modifiers: Modifiers::empty(),
        },
        || println!("pressed key"),
    )
    .unwrap();

No keys get registered. I found that putting Modifier keys in the key_code variable does work, and I can combine e.g. RightAlt + Modifiers::META. Any non-modifier key does not get registered.

CryZe commented 4 months ago

I'm assuming this is #659. Can you try with the master branch?

M1KUS3Q commented 4 months ago

Downloaded the livesplit-hotkey crate from master and replaced the dependency in my code, and now no events get sent at all. Tried with regular keys, as well as modifier keys, no events seem to go through.

I can also add that using the crate rdev results in the same behaviour as the crates.io version of livesplit-hotkey. Mouse events and modifier keypresses go through, but no other keys do.

M1KUS3Q commented 4 months ago

Updated to MacOS 14.3.1 and it started working. Thanks for help.