{"id":42122722,"url":"https://github.com/kpeu3i/gods4","last_synced_at":"2026-01-26T14:35:07.840Z","repository":{"id":94098306,"uuid":"171037312","full_name":"kpeu3i/gods4","owner":"kpeu3i","description":"Golang library to interact with Sony DualShock4","archived":false,"fork":false,"pushed_at":"2019-02-16T21:03:37.000Z","size":10,"stargazers_count":27,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T06:53:23.247Z","etag":null,"topics":["dualshock","dualshock4","game-controller","golang","hid","playstation4"],"latest_commit_sha":null,"homepage":"","language":"Go","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/kpeu3i.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-16T18:31:13.000Z","updated_at":"2023-09-08T17:50:31.000Z","dependencies_parsed_at":"2023-04-25T02:46:56.490Z","dependency_job_id":null,"html_url":"https://github.com/kpeu3i/gods4","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kpeu3i/gods4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpeu3i%2Fgods4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpeu3i%2Fgods4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpeu3i%2Fgods4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpeu3i%2Fgods4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kpeu3i","download_url":"https://codeload.github.com/kpeu3i/gods4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpeu3i%2Fgods4/sbom","scorecard":{"id":568961,"data":{"date":"2025-08-11","repo":{"name":"github.com/kpeu3i/gods4","commit":"081d376c7200ad942f66092e5536a64af6b4e1ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/1 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T15:47:39.465Z","repository_id":94098306,"created_at":"2025-08-20T15:47:39.465Z","updated_at":"2025-08-20T15:47:39.465Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28780350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"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":["dualshock","dualshock4","game-controller","golang","hid","playstation4"],"created_at":"2026-01-26T14:35:07.777Z","updated_at":"2026-01-26T14:35:07.827Z","avatar_url":"https://github.com/kpeu3i.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gods4\n\nA userspace cross-platform driver for Sony DualShock 4 controller over HID.\nWorks for Bluetooth and USB connections.\n\n## Features\n\n* Buttons: x, circle, square, triangle, share, options, touchpad\n* D-pad: up, down, left, right (also intermediate positions)\n* Analog sticks: left, right\n* Analog triggers: L2, R2\n* Touchpad: 2 touches and button\n* Battery\n* Gyroscope (absolute orientation)\n* Accelerometer (relative movement)\n* Activating the motors (rumble)\n* Setting the LED color\n\n## Install\n\nUse go get to install the latest version of the library:\n\n    go get github.com/kpeu3i/gods4@v1.0.0\n\nNext, include ds4 in your application:\n\n```go\nimport \"github.com/kpeu3i/gods4\"\n```\n\n## Usage\n\nFirst, connect the controller to your computer using a micro-USB cable or Bluetooth.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/kpeu3i/gods4\"\n\t\"github.com/kpeu3i/gods4/led\"\n\t\"github.com/kpeu3i/gods4/rumble\"\n)\n\nfunc main() {\n\t// Find all controllers connected to your machine via USB or Bluetooth\n\tcontrollers := gods4.Find()\n\tif len(controllers) == 0 {\n\t\tpanic(\"No connected DS4 controllers found\")\n\t}\n\n\t// Select first controller from the list\n\tcontroller := controllers[0]\n\n\t// Connect to the controller\n\terr := controller.Connect()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlog.Printf(\"* Controller #1 | %-10s | name: %s, connection: %s\\n\", \"Connect\", controller, controller.ConnectionType())\n\n\t// Disconnect controller when a program is terminated\n\tsignals := make(chan os.Signal, 1)\n\tsignal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)\n\tgo func() {\n\t\t\u003c-signals\n\t\terr := controller.Disconnect()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tlog.Printf(\"* Controller #1 | %-10s | bye!\\n\", \"Disconnect\")\n\t}()\n\n\t// Register callback for \"BatteryUpdate\" event\n\tcontroller.On(gods4.EventBatteryUpdate, func(data interface{}) error {\n\t\tbattery := data.(gods4.Battery)\n\t\tlog.Printf(\"* Controller #1 | %-10s | capacity: %v%%, charging: %v, cable: %v\\n\",\n\t\t\t\"Battery\",\n\t\t\tbattery.Capacity,\n\t\t\tbattery.IsCharging,\n\t\t\tbattery.IsCableConnected,\n\t\t)\n\n\t\treturn nil\n\t})\n\n\t// Register callback for \"CrossPress\" event\n\tcontroller.On(gods4.EventCrossPress, func(data interface{}) error {\n\t\tlog.Printf(\"* Controller #1 | %-10s | state: press\\n\", \"Cross\")\n\n\t\treturn nil\n\t})\n\n\t// Register callback for \"CrossRelease\" event\n\tcontroller.On(gods4.EventCrossRelease, func(data interface{}) error {\n\t\tlog.Printf(\"* Controller #1 | %-10s | state: release\\n\", \"Cross\")\n\n\t\treturn nil\n\t})\n\n\t// Register callback for \"RightStickMove\" event\n\tcontroller.On(gods4.EventRightStickMove, func(data interface{}) error {\n\t\tstick := data.(gods4.Stick)\n\t\tlog.Printf(\"* Controller #1 | %-10s | x: %v, y: %v\\n\", \"RightStick\", stick.X, stick.Y)\n\n\t\treturn nil\n\t})\n\n\t// Enable left and right rumble motors\n\terr = controller.Rumble(rumble.Both())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Enable LED (yellow) with flash\n\terr = controller.Led(led.Yellow().Flash(50, 50))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Start listening for controller events\n\terr = controller.Listen()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Output:\n\t// 2019/02/16 17:00:23 * Controller #1 | Connect    | name: Wireless Controller (vendor: 1356, product: 2508), connection: BT\n\t// 2019/02/16 17:00:23 * Controller #1 | Battery    | capacity: 77%, charging: false, cable: false\n\t// 2019/02/16 17:00:34 * Controller #1 | Cross      | state: press\n\t// 2019/02/16 17:00:34 * Controller #1 | Cross      | state: release\n\t// 2019/02/16 17:00:39 * Controller #1 | RightStick | x: 187, y: 98\n\t// 2019/02/16 17:00:39 * Controller #1 | RightStick | x: 191, y: 94\n\t// 2019/02/16 17:00:39 * Controller #1 | RightStick | x: 196, y: 93\n\t// 2019/02/16 17:00:39 * Controller #1 | RightStick | x: 212, y: 88\n\t// 2019/02/16 17:00:39 * Controller #1 | RightStick | x: 228, y: 79\n\t// 2019/02/16 17:02:52 * Controller #1 | Disconnect | bye!\n}\n```\n\n\n## Events\n\nEvents on which you can subscribe are listed below:\n\nName | Data\n--- | ---\nEventCrossPress | nil\nEventCrossRelease | nil\nEventCirclePress | nil\nEventCircleRelease | nil\nEventSquarePress  | nil\nEventSquareRelease | nil\nEventTrianglePress  | nil\nEventTriangleRelease | nil\nEventL1Press | nil\nEventL1Release | nil\nEventL2Press  | byte\nEventL2Release | byte\nEventL3Press | nil\nEventL3Release  | nil\nEventR1Press | nil\nEventR1Release | nil\nEventR2Press | byte\nEventR2Release | byte\nEventR3Press | nil\nEventR3Release | nil\nEventDPadUpPress | nil\nEventDPadUpRelease | nil\nEventDPadDownPress | nil\nEventDPadDownRelease | nil\nEventDPadLeftPress | nil\nEventDPadLeftRelease | nil\nEventDPadRightPress | nil\nEventDPadRightRelease | nil\nEventSharePress | nil\nEventShareRelease | nil\nEventOptionsPress | nil\nEventOptionsRelease | nil\nEventTouchpadSwipe | Touchpad\nEventTouchpadPress | Touchpad\nEventTouchpadRelease | Touchpad\nEventPSPress | nil\nEventPSRelease | nil\nEventLeftStickMove | Stick\nEventRightStickMove | Stick\nEventAccelerometerUpdate | Accelerometer\nEventGyroscopeUpdate | Gyroscope\nEventBatteryUpdate | Battery\n\n## TODO\n\n* Microphone/speaker\n* Tests\n\n## References\n\nThe DualShock 4 report format is not open and these resources have been very helpful when creating gods4:\n\n* https://github.com/seidtgeist/node-ds4\n* https://github.com/ehd/node-ds4\n* https://github.com/chrippa/ds4drv\n* http://www.psdevwiki.com/ps4/DualShock_4\n* http://eleccelerator.com/wiki/index.php?title=DualShock_4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpeu3i%2Fgods4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkpeu3i%2Fgods4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpeu3i%2Fgods4/lists"}