{"id":15775104,"url":"https://github.com/jtyr/hid-event-processor","last_synced_at":"2026-04-24T20:36:57.392Z","repository":{"id":44729360,"uuid":"445644877","full_name":"jtyr/hid-event-processor","owner":"jtyr","description":"Event processor for HID devices.","archived":false,"fork":false,"pushed_at":"2022-01-28T10:21:33.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-10T06:39:07.572Z","etag":null,"topics":["bose","event","headphones","headphones-button","headset","headset-control","hid","linux","microphone","mute","usb","usb-devices","usb-hid"],"latest_commit_sha":null,"homepage":"","language":"Python","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/jtyr.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":"2022-01-07T20:30:43.000Z","updated_at":"2024-05-07T03:17:26.000Z","dependencies_parsed_at":"2022-08-30T02:11:08.677Z","dependency_job_id":null,"html_url":"https://github.com/jtyr/hid-event-processor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jtyr/hid-event-processor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fhid-event-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fhid-event-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fhid-event-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fhid-event-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtyr","download_url":"https://codeload.github.com/jtyr/hid-event-processor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fhid-event-processor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32240240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bose","event","headphones","headphones-button","headset","headset-control","hid","linux","microphone","mute","usb","usb-devices","usb-hid"],"created_at":"2024-10-04T16:42:20.822Z","updated_at":"2026-04-24T20:36:57.359Z","avatar_url":"https://github.com/jtyr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HID Event Processor (HEP)\n\nThis is a simple event processor for HID devices (e.g. USB keyboards or\nheadsets) which allows to run a command when a key (e.g. multimedia key or\nheadset button) is pressed.\n\n## Motivation\n\nI got the [Bose\n700](https://www.bose.co.uk/en_gb/products/headphones/noise_cancelling_headphones/noise-cancelling-headphones-700.html)\nfor free with my new phone but unfortunately the headphones, when connected\ndirectly via Bluetooth, don't have any way how I can mute the mic when on a\nconference call (e.g. Zoom, Teams, Google Chat). So I bought the [Bose USB\nLink](https://www.bose.co.uk/en_gb/products/headphones/headphone_accessories/bose-usb-link.html)\nthat should solve this problem. Unfortunately the muting (long-press on the\nright hand side ear cup) didn't work out of the box and required to remap the\n`KEY_MICMUTE` key to `F20` key. That was simply done using UDEV:\n\n```shell\nsudo cat \u003c\u003cEND \u003e /etc/udev/hwdb.d/99-bose.hwdb`\nevdev:input:b0003v05a7pa310*\n KEYBOARD_KEY_b002f=f20\n KEYBOARD_KEY_ff990004=f20\nEND\nsudo systemd-hwdb update\nsudo udevadm trigger\n```\n\nUnfortunately this way it didn't visually nor acoustically indicate if the mic\nis muted or unmuted. That's why I have decided to write HEP which allows to run\na script on any event from the headphones without the need to remap any keys.\n\nThe\n[script](https://github.com/jtyr/hid-event-processor/blob/main/scripts/bose.sh)\ncan mute/unmute the mic and change the light color on the Bose USB Link (that\nmakes the headphones to play a sound) using system tools like\n[`evtest`](https://cgit.freedesktop.org/evtest/),\n[`pactl`](https://www.freedesktop.org/wiki/Software/PulseAudio/) and\n[`evemu-event`](https://www.freedesktop.org/wiki/Evemu).\n\n## Installation\n\n### Python packages\n\nHEP requires some non-standard packages. Those can be installed by using `pip`\n(the `requirements.txt` file can be found in the [HEP Git\nrepository](https://github.com/jtyr/hid-event-processor)):\n\n```shell\npip install -r requirements.txt\n```\n\nOn Arch Linux it can be installed using system packages:\n\n```shell\npacman -S python-evdev python-yaml\n```\n\n### Using per-user Systemd instance\n\n\u003e This requires [Systemd instance running under a\nuser](https://wiki.archlinux.org/title/systemd/User).\n\nThe HEP can be installed like this:\n\n```shell\ncd ~/\ngit clone https://github.com/jtyr/hid-event-processor.git\nmkdir -p ~/.config/systemd/user/\nln -s ~/hid-event-processor/systemd/hep.service ~/.config/systemd/user/\ncat \u003c\u003cEND \u003e ~/.config/systemd/hep.conf\nHEP_PATH=~/hid-event-processor/hep.py\nEND\nsystemd --user enable hep\nsystemd --user start hep\n```\n\n### Ad-hoc from command line\n\n```shell\ncd ~/\ngit clone https://github.com/jtyr/hid-event-processor.git\ncd hid-event-processor\n./hep.py\n```\n\n## Configuration\n\nConfiguration is done by creating a YAML file that contains definition which\ndevices and keys should be monitored and what command to execute when the event\nappears:\n\n```yaml\n# Configuration for the \"Logitech Pro Gaming Keyboard\"\n- device:\n    # Device identification\n    vendor: 0x46d\n    product: 0xc339\n    version: 0x111\n  keys:\n    # Play/Pause key down\n    - type: 1\n      code: 164\n      value: 1\n      # Simple command to run\n      command: kcalc\n      # Run on background\n      background: true\n    # FastForward key down\n    - type: 1\n      code: 163\n      value: 1\n      # Simple command to run\n      command: drawio\n      # Run on background\n      background: true\n\n# Configuration for the \"Bose 700 ACM Headphones\"\n- device:\n    # Device identification\n    vendor: 0x5a7\n    product: 0xa310\n    version: 0x111\n  keys:\n    # MSC_SCAN on KEY_MICMUTE longpress\n    - type: 4\n      code: 4\n      value: b002f\n      # Multi-argument command to run\n      command:\n        - ~/bin/bose.sh\n        - toggle\n        # Use the actual device path as one of the command parameters\n        - \"{{ device.path }}\"\n    # MSC_SCAN on BTN_0 press\n    - type: 4\n      code: 4\n      value: ff990004\n      # Multi-argument command to run\n      command:\n        - ~/bin/bose.sh\n        - toggle\n        # Find a device that has the specivied capability (17=EV_LED, 7=LED_MUTE)\n        - \"{{ device[cap=17,subcap=7].path }}\"\n    # MSC_SCAN on KEY_PLAY (hangup)\n    - type: 4\n      code: 4\n      value: c00b0\n      # Multi-argument command to run\n      command:\n        - ~/bin/bose.sh\n        - hangup\n        # Find a device that has the specivied capability (17=EV_LED, 7=LED_MUTE)\n        - \"{{ device[cap=17,subcap=7].path }}\"\n```\n\nThe device and key details can be found by using\n[`evtest`](https://cgit.freedesktop.org/evtest/) tool.\n\n## Author\n\nJiri Tyr\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtyr%2Fhid-event-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtyr%2Fhid-event-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtyr%2Fhid-event-processor/lists"}