{"id":29995126,"url":"https://github.com/micmonay/keybd_event-rs","last_synced_at":"2025-08-05T01:11:26.509Z","repository":{"id":62441598,"uuid":"201620773","full_name":"micmonay/keybd_event-rs","owner":"micmonay","description":"Simulating keyboard on Linux, Windows and Mac OS in rust","archived":false,"fork":false,"pushed_at":"2019-08-11T05:43:58.000Z","size":43,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T04:19:01.897Z","etag":null,"topics":["keyboard","keyboard-layout","linux","multiplatform","rust","simulation","uinput"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micmonay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-10T11:28:08.000Z","updated_at":"2023-01-17T00:32:47.000Z","dependencies_parsed_at":"2022-11-01T21:53:45.600Z","dependency_job_id":null,"html_url":"https://github.com/micmonay/keybd_event-rs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/micmonay/keybd_event-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmonay%2Fkeybd_event-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmonay%2Fkeybd_event-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmonay%2Fkeybd_event-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmonay%2Fkeybd_event-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micmonay","download_url":"https://codeload.github.com/micmonay/keybd_event-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micmonay%2Fkeybd_event-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268815468,"owners_count":24311569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keyboard","keyboard-layout","linux","multiplatform","rust","simulation","uinput"],"created_at":"2025-08-05T01:05:07.730Z","updated_at":"2025-08-05T01:11:26.502Z","avatar_url":"https://github.com/micmonay.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":" # Simulating keyboard on Linux, Windows and Mac OS in rust\n\n On the next example, the library simulates key A, Z pressed.\n\n **The keyboard layout on the computer is important!**\n\n If you use a keyboard layout the US, you have corresponding keys, but if you use, for example, the french layout, you have another result.\n ```rust\nextern crate keybd_event;\n\n#[cfg(target_os = \"linux\")]\nuse std::thread::sleep;\n#[cfg(target_os = \"linux\")]\nuse std::time::Duration;\nuse keybd_event::KeyboardKey::{KeyA,KeyZ};\nuse keybd_event::KeyBondingInstance;\n\nfn main() {\n    let mut kb = KeyBondingInstance::new().unwrap();\n    #[cfg(target_os = \"linux\")]\n        sleep(Duration::from_secs(2));\n    kb.has_shift(true);\n    kb.add_keys(\u0026[KeyA, KeyZ]);\n    kb.launching();\n}\n ```\n![keyboard](./keyboard-rust.png)\n\n ## Linux\n\n On Linux this library use **uinput**, but generally the uinput is only for the root user.\n\n The easy solution is executing on root user or change permission by `chmod`, but it is not good.\n\n You can follow the next example, for more security.\n\n```bash\nsudo groupadd uinput\nsudo usermod -a -G uinput my_username\nsudo udevadm control --reload-rules\necho \"SUBSYSTEM==\\\"misc\\\", KERNEL==\\\"uinput\\\", GROUP=\\\"uinput\\\", MODE=\\\"0660\\\"\" | sudo tee /etc/udev/rules.d/uinput.rules\necho uinput | sudo tee /etc/modules-load.d/uinput.conf\n```\n\n Another subtlety on Linux, it is important after creating **KeyBondingInstance**, to waiting 2 seconds before running first keyboard actions\n\n ## Darwin (MAC OS)\n This library depends on the frameworks Apple, I did not find a solution for cross-compilation.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicmonay%2Fkeybd_event-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicmonay%2Fkeybd_event-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicmonay%2Fkeybd_event-rs/lists"}