LiveSplit / livesplit-core

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.

Home Page:https://livesplit.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only modifier keys get registered on MacOS

M1KUS3Q opened this issue · comments

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.

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

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.

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