{"id":15606155,"url":"https://github.com/paulfioravanti/hid_hosts","last_synced_at":"2026-02-03T11:04:43.830Z","repository":{"id":41371864,"uuid":"509324487","full_name":"paulfioravanti/hid_hosts","owner":"paulfioravanti","description":"HID host scripts to communicate back and forth with QMK keyboards","archived":false,"fork":false,"pushed_at":"2024-02-09T00:28:07.000Z","size":161,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T20:39:33.370Z","etag":null,"topics":["clang","hid","hidapi","keyboard","macos","qmk","stenography"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulfioravanti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-01T04:53:42.000Z","updated_at":"2023-10-25T08:17:15.000Z","dependencies_parsed_at":"2024-02-09T02:05:36.524Z","dependency_job_id":null,"html_url":"https://github.com/paulfioravanti/hid_hosts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paulfioravanti/hid_hosts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fhid_hosts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fhid_hosts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fhid_hosts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fhid_hosts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulfioravanti","download_url":"https://codeload.github.com/paulfioravanti/hid_hosts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfioravanti%2Fhid_hosts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29043735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["clang","hid","hidapi","keyboard","macos","qmk","stenography"],"created_at":"2024-10-03T04:21:22.269Z","updated_at":"2026-02-03T11:04:43.781Z","avatar_url":"https://github.com/paulfioravanti.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HID Hosts\n\nThis repository contains code I use to communicate with [QMK][] firmware-powered\nkeyboards via the [Human Interface Device][] (HID) class of the [USB][]\nspecification.\n\nBasically, I want to trigger keyboard functionality from external devices, like\nUSB foot pedals etc, and QMK's [Raw HID][] feature allows this to happen. But, a\n\"host\" is required to send and receive the messages to the keyboard.\n\nThe code is currently solely concerned with passing messages to and from\n[Georgi][] stenographic keyboards (see the `raw_hid_receive` function definition\nin [my Georgi keymap][] to see how the message is received, handled, and then\nsent back to the computer), but it can be adapted for any keyboard's QMK\nfirmware:\n\n- Find your keyboard's firmware in QMK's [keyboard list][]\n- Look for the `VENDOR_ID` and `PRODUCT_ID` values in the top-level `config.h`\n  file\n- Substitute those values, as well as any payload changes you want to make, into\n  whatever file in this repo you would like to use\n\n## Blog Post\n\nI wrote a post covering the pain points I went through in trying to get a stable\nHID connection to my Georgi, and the solution that got integrated to this repo's\nhost code here:\n\n- _[Get on the Same Page as your HID Device][]_\n\n## Prerequisites\n\n### HIDAPI\n\nThe [HIDAPI][] library is required to open up HID communication channels, so\ninstall it with your operating system's package manager. HIDAPI provides some\nminimal information about this in their [Installing HIDAPI][] section, but if\nyou are using macOS, you can install it with [Homebrew][]:\n\n```sh\nbrew install hidapi\n```\n\n### Steno Tape\n\nThe HID host uses the [Steno Tape][] library to output custom entries to the\nsteno tape, so that needs to be installed:\n\n```sh\ngit clone git@github.com:paulfioravanti/steno_tape.git\ncd steno_tape\nmake install\n```\n\n### `pkg-config`\n\nFeel free to compile the host as you see fit, but I use [pkg-config][]\n([repo][pkg-config repo]) to provide an easier interface to include libraries.\nYou can install it via your operating system package manager, or use Homebrew if\nyou use macOS:\n\n```sh\nbrew install pkg-config\n```\n\n## Compile\n\nIf you use `pkg-config`, you can use the included build file:\n\n```sh\n./build.sh\n```\n\nOtherwise, feel free to use it as a guide to make your own.\n\n## Run\n\nCurrently, the C executable only accounts for integers to be sent through as\ncommand line parameters, which are then received in [my Georgi keymap][].\n\n```sh\n./hid_host 1\n./hid_host 2\n```\n\nIn order to run the host with an [Elgato Stream Deck Pedal][], I needed to\ncreate a simple [shell][] wrapper around the [C][] executable\n(`hid_host_client.sh`), since the only kinds of external scripts [Stream Deck][]\nseems to be able to run are shell scripts:\n\n![Stream Deck Doom Typist config][Stream Deck Doom Typist config image url]\n\n```sh\n./hid_host_client.sh 1\n./hid_host_client.sh 2\n```\n\n## Troubleshooting\n\nI have had issues where I was getting random errors when reading to or writing\nfrom the HID device (in this case, the Georgi). Going into the Keyboard\nsettings for macOS and changing/resetting the \"Key repeat rate\" and/or the\n\"Delay until repeat\" settings, and _then_ restarting the computing seemed to get\nthings more stable.\n\nMore info at:\n\n- [Is it possible to adjust the key repeat rate?][]\n- [How to increase keyboard key repeat rate on OS X?][]\n\n## Steno Tape Custom Entries Architecture\n\n```mermaid\n---\ntitle: Steno Tape Custom Entries\n---\nflowchart BT\n  FirmwareRawHID[\"Raw HID\"]\n  FirmwareProcessRecordUser[\"Process Record User\"]\n  HIDHost[\"HID Host\"]\n  HIDHostClient[\"HID Host Client\"]\n  StenoTapeLibrary[\"Steno Tape Library\"]\n  StenoTapeClient[\"Steno Tape Client\"]\n  StenoTapeCustomEntriesWorkflow[\"Steno Tape Custom Entries Workflow\"]\n  StreamDeck[\"Stream Deck\"]\n  StreamDeckPedal[/\"STREAM DECK PEDAL\"\\]\n  TapeyTape[Tapey Tape]\n  TapeLogFile[\"Tape Log\\n(tapey_tape.txt)\"]\n  TapeFilterScript[\"Tape Filter Script\"]\n\n  classDef current fill:#ffb3b3, stroke:#333, stroke-width:4px, color:black\n\n  subgraph Computer[\"COMPUTER\"]\n    subgraph Alfred[\"Alfred\"]\n      StenoTapeCustomEntriesWorkflow\n    end\n\n    subgraph Elgato[\"Elgato\"]\n      StreamDeck\n    end\n\n    subgraph HIDHosts[\"HID Hosts\"]\n      HIDHost:::current\n      HIDHostClient:::current -- \"`./hid_host`\" --\u003e HIDHost\n    end\n    class HIDHosts current\n\n    subgraph Plover[\"Plover\"]\n      subgraph Plugins\n        TapeLogFile\n        TapeyTape -- outputs to --\u003e TapeLogFile\n      end\n    end\n\n    subgraph StenoTape[\"Steno Tape\"]\n      StenoTapeLibrary\n      StenoTapeClient -- \"calls API\" --\u003e StenoTapeLibrary\n      TapeFilterScript\n    end\n\n    Terminal(Terminal)\n  end\n\n  subgraph Keyboard[\"KEYBOARD\"]\n    subgraph QMKFirmware[\"QMK Firmware\"]\n      FirmwareProcessRecordUser\n      FirmwareRawHID\n    end\n  end\n\n  Terminal -- \"`./run-tape-feed.sh --filter`\" --\u003e TapeFilterScript\n  TapeFilterScript -- filters --\u003e TapeLogFile\n  StenoTapeLibrary -- outputs to --\u003e TapeLogFile\n  StenoTapeCustomEntriesWorkflow -- \"`./steno_tape_client`\" --\u003e StenoTapeClient\n  FirmwareProcessRecordUser -- \"SEND_STRING(...)\" --\u003e StenoTapeCustomEntriesWorkflow\n  HIDHost -- \"calls API\" --\u003e StenoTapeLibrary\n  FirmwareRawHID -. \"hid_read/\\nraw_hid_send\" .-\u003e HIDHost\n  HIDHost -- \"hid_write/\\nraw_hid_receive\" --\u003e FirmwareRawHID\n  StreamDeck -- \"`./hid_host_client.sh`\" --\u003e HIDHostClient\n  StreamDeckPedal -- connects --\u003e StreamDeck\n\n  click Dictionaries href \"https://github.com/paulfioravanti/steno-dictionaries\" \"Steno Dictionaries\" _blank\n  click FirmwareRawHID href \"https://github.com/paulfioravanti/qmk_keymaps/blob/master/keyboards/gboards/georgi/keymaps/paulfioravanti/user/hid.c\" \"Georgi HID\" _blank\n  click FirmwareProcessRecordUser href \"https://github.com/paulfioravanti/qmk_keymaps/blob/master/keyboards/gboards/georgi/keymaps/paulfioravanti/user/process_record_user.c\" \"Georgi Process Record User\" _blank\n  click HIDHost href \"https://github.com/paulfioravanti/hid_hosts/blob/main/hid_host.c\" \"HID Host\" _blank\n  click HIDHostClient href \"https://github.com/paulfioravanti/hid_hosts/blob/main/hid_host_client.sh\" \"HID Host Client\" _blank\n  click StenoTapeClient href \"https://github.com/paulfioravanti/steno_tape/blob/main/clients/steno_tape_client.c\" \"Steno Tape Client\" _blank\n  click StenoTapeCustomEntriesWorkflow href \"https://github.com/paulfioravanti/dotfiles/tree/master/macos/alfred\" \"Steno Tape Custom Entries Workflow\" _blank\n  click StenoTapeLibrary href \"https://github.com/paulfioravanti/steno_tape/blob/main/src/steno_tape.c\" \"Steno Tape\" _blank\n  click StreamDeck href \"https://www.elgato.com/us/en/s/welcome-to-stream-deck\" \"Stream Deck\" _blank\n  click StreamDeckPedal href \"https://www.elgato.com/us/en/p/stream-deck-pedal\" \"Stream Deck Pedal\" _blank\n  click TapeyTape href \"https://github.com/rabbitgrowth/plover-tapey-tape\" \"Tapey Tape\" _blank\n  click TapeFilterScript href \"https://github.com/paulfioravanti/steno_tape/blob/main/bin/run-tape-feed.sh\" \"Tape Filter Script\" _blank\n```\n\n[C]: https://en.wikipedia.org/wiki/C_(programming_language)\n[Elgato Stream Deck Pedal]: https://www.elgato.com/us/en/p/stream-deck-pedal\n[Georgi]: https://www.gboards.ca/product/georgi\n[Get on the Same Page as your HID Device]: https://www.paulfioravanti.com/blog/same-page-hid-device/\n[HIDAPI]: https://github.com/libusb/hidapi\n[Homebrew]: https://brew.sh/\n[How to increase keyboard key repeat rate on OS X?]: https://apple.stackexchange.com/questions/10467/how-to-increase-keyboard-key-repeat-rate-on-os-x\n[Human Interface Device]: https://en.wikipedia.org/wiki/USB_human_interface_device_class\n[Installing HIDAPI]: https://github.com/libusb/hidapi#installing-hidapi\n[Is it possible to adjust the key repeat rate?]: https://karabiner-elements.pqrs.org/docs/help/how-to/key-repeat/\n[keyboard list]: https://github.com/qmk/qmk_firmware/tree/master/keyboards\n[my Georgi keymap]: https://github.com/paulfioravanti/qmk_keymaps/blob/master/keyboards/gboards/georgi/keymaps/paulfioravanti/user/hid.c\n[pkg-config]: https://en.wikipedia.org/wiki/Pkg-config\n[pkg-config repo]: https://gitlab.freedesktop.org/pkg-config/pkg-config\n[QMK]: https://qmk.fm/\n[Raw HID]: https://docs.qmk.fm/#/feature_rawhid\n[shell]: https://en.wikipedia.org/wiki/Shell_script\n[Steno Tape]: https://github.com/paulfioravanti/steno_tape\n[Stream Deck]: https://www.elgato.com/us/en/s/welcome-to-stream-deck\n[Stream Deck Doom Typist config image url]: ./assets/stream-deck-doom-typist.jpg\n[USB]: https://en.wikipedia.org/wiki/USB\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulfioravanti%2Fhid_hosts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulfioravanti%2Fhid_hosts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulfioravanti%2Fhid_hosts/lists"}