Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: CapsLock not working #163

Closed
pentamassiv opened this issue Mar 26, 2023 · 1 comment · Fixed by #329
Closed

macOS: CapsLock not working #163

pentamassiv opened this issue Mar 26, 2023 · 1 comment · Fixed by #329

Comments

@pentamassiv
Copy link
Collaborator

Describe the bug
CapsLock seems to have no effect

To Reproduce

use enigo::{Enigo, Key, KeyboardControllable};
use std::thread;
use std::time::Duration;

fn main() {
    thread::sleep(Duration::from_secs(2));
    let mut enigo = Enigo::new();

    enigo.key_click(Key::Layout('a'));
    enigo.key_click(Key::CapsLock);
    enigo.key_click(Key::Layout('a'));
}

Expected behavior
The letters aA should be typed.

Environment (please complete the following information):

  • OS:macOS
  • Rust [e.g. rustc --version]
  • enigo 0.0.15

Additional context
This seems to be a know issue. I only found out about it because I read: https://eastmanreference.com/complete-list-of-applescript-key-codes

@pentamassiv
Copy link
Collaborator Author

Instead of CapsLock, the shift can get activated. We need to store the shift state so we can toggle it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant