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: Key::Unicode('🔥') enters the char a #343

Open
pentamassiv opened this issue Oct 27, 2024 · 1 comment
Open

macOS: Key::Unicode('🔥') enters the char a #343

pentamassiv opened this issue Oct 27, 2024 · 1 comment

Comments

@pentamassiv
Copy link
Collaborator

pentamassiv commented Oct 27, 2024

Describe the bug
Whenever Key::Unicode('🔥') is entered, the letter a gets typed

To Reproduce

use enigo::{Direction::Click, Enigo, Key, Keyboard, Settings};
use std::thread;
use std::time::Duration;

fn main() {
    env_logger::init();
    thread::sleep(Duration::from_secs(2));
    let mut enigo = Enigo::new(&Settings::default()).unwrap();
    enigo.key(Key::Unicode('🔥'), Click).unwrap();
}

Expected behavior
The character 🔥 should get typed or at least an error should be thrown instead

Environment (please complete the following information):

  • OS: macOS
  • Rust 1.82
  • Library Version: enigo e06beb3 (current main branch)
@valkrypton
Copy link

valkrypton commented Nov 18, 2024

enigo uses hardware keycodes to figure out which key is pressed, therefore '🔥' is not typed since it is a virtual key. You need to click ctrl + cmd + space, that opens the emoji menu and click the fire from there, so i dont see how you can simulate the emoji being typed from calling the key function

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

No branches or pull requests

2 participants