{"id":20086877,"url":"https://github.com/nelsongillo/keyfn","last_synced_at":"2025-06-15T21:02:32.709Z","repository":{"id":57634710,"uuid":"246413457","full_name":"nelsongillo/keyfn","owner":"nelsongillo","description":"bind key events (press/release) to functions in rust","archived":false,"fork":false,"pushed_at":"2020-03-31T16:34:45.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-31T11:52:41.720Z","etag":null,"topics":["keybinder","rust","xlib"],"latest_commit_sha":null,"homepage":"","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/nelsongillo.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":"2020-03-10T21:36:43.000Z","updated_at":"2020-09-06T10:59:04.000Z","dependencies_parsed_at":"2022-09-27T10:50:37.342Z","dependency_job_id":null,"html_url":"https://github.com/nelsongillo/keyfn","commit_stats":null,"previous_names":["nelsongillo/keyfn","einzigartigername/keyfn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsongillo%2Fkeyfn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsongillo%2Fkeyfn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsongillo%2Fkeyfn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nelsongillo%2Fkeyfn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nelsongillo","download_url":"https://codeload.github.com/nelsongillo/keyfn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241520649,"owners_count":19975892,"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","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":["keybinder","rust","xlib"],"created_at":"2024-11-13T16:02:53.399Z","updated_at":"2025-03-02T14:29:37.260Z","avatar_url":"https://github.com/nelsongillo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keyfn\nBind key events (press/release) to functions in rust using xlib.\\\nSupports same key with different modifier. Functions are executed in new threads.\n\n## Usage\nAdd this to your `Cargo.toml`\n```\n[dependencies]\nkeyfn = \"0.2.1\"\n```\n\n## Example\n``` rust\nextern crate keyfn;\n\nuse keyfn::*;\n\nfn main(){\n    // create new KeyStorage\n    let mut storage = KeyStorage::new();\n\n    // Call crtl-a_pressed when Control + a is pressed\n    let ctrl_a = KeyBind::new(\n        keysym::XK_a,\n        vec![Mod::Control],\n        Trigger::Pressed,\n        ctrl_a_pressed,\n    );\n    \n    // Add KeyBind to storage\n    storage.add(ctrl_a);\n\n    // start storage\n    storage.start();\n}\n\nfn ctrl_a_pressed(){\n    println!(\"Control + A pressed!\");\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelsongillo%2Fkeyfn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnelsongillo%2Fkeyfn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelsongillo%2Fkeyfn/lists"}