{"id":22458787,"url":"https://github.com/halildurmus/win32_gamepad","last_synced_at":"2026-02-23T16:15:11.696Z","repository":{"id":43807630,"uuid":"460311773","full_name":"halildurmus/win32_gamepad","owner":"halildurmus","description":"Interact with gamepads connected to a Windows machine.","archived":false,"fork":false,"pushed_at":"2025-11-20T22:46:51.000Z","size":214,"stargazers_count":25,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-21T00:17:27.867Z","etag":null,"topics":["dart","flutter","gamepad","win32","windows"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halildurmus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"halildurmus"}},"created_at":"2022-02-17T06:36:39.000Z","updated_at":"2025-11-20T22:46:54.000Z","dependencies_parsed_at":"2024-07-29T18:22:32.037Z","dependency_job_id":"51549d15-e99b-4bf3-a7d0-80611dc7a6be","html_url":"https://github.com/halildurmus/win32_gamepad","commit_stats":null,"previous_names":["timsneath/win32_gamepad","halildurmus/win32_gamepad","dart-windows/win32_gamepad"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/halildurmus/win32_gamepad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halildurmus%2Fwin32_gamepad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halildurmus%2Fwin32_gamepad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halildurmus%2Fwin32_gamepad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halildurmus%2Fwin32_gamepad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halildurmus","download_url":"https://codeload.github.com/halildurmus/win32_gamepad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halildurmus%2Fwin32_gamepad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29748021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"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":["dart","flutter","gamepad","win32","windows"],"created_at":"2024-12-06T08:14:22.540Z","updated_at":"2026-02-23T16:15:11.690Z","avatar_url":"https://github.com/halildurmus.png","language":"Dart","funding_links":["https://github.com/sponsors/halildurmus"],"categories":[],"sub_categories":[],"readme":"[![ci][ci_badge]][ci_link]\n[![Package: win32_gamepad][package_badge]][package_link]\n[![Publisher: halildurmus.dev][publisher_badge]][publisher_link]\n[![Language: Dart][language_badge]][language_link]\n[![License: BSD-3-Clause][license_badge]][license_link]\n\n**A modern, type-safe Dart API for accessing gamepads connected to a Windows\nmachine.**\n\nThis package builds on top of the [package:win32][win32_pub_dev_link] and\nprovides a high-level abstraction over native registry APIs. It eliminates the\nneed to work directly with FFI, raw pointers, or low-level Win32 calls while\npreserving performance and correctness.\n\n## ✨ Features\n\n- **Connect up to 4 gamepads** — supports all four XInput controller slots\n- **Poll buttons, triggers \u0026 thumbsticks** — full access to every input via a\n  clean `GamepadState` object\n- **Rumble motor control** — independently set left and right vibration motor\n  speeds\n- **Battery information** — query battery level and type for wireless\n  controllers\n\n## 🚀 Getting Started\n\nAdd the package to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  win32_gamepad: ^1.0.10\n```\n\nThen import it:\n\n```dart\nimport 'package:win32_gamepad/win32_gamepad.dart';\n```\n\n## ⚡ Quick Example\n\nCreate a `Gamepad` instance by passing the controller index (0–3):\n\n```dart\nfinal gamepad = Gamepad(0); // primary controller\n```\n\nWindows supports up to four gamepads simultaneously. Poll the gamepad by calling\n[`updateState()`][update_state_method_link] in your game loop, then inspect the\n[`state`][state_class_link] object for buttons, triggers, and thumbstick values.\nRumble motors can be activated with the [`vibrate`][vibrate_method_link] method.\n\n```dart\nimport 'dart:io';\n\nimport 'package:win32_gamepad/win32_gamepad.dart';\n\nvoid main() {\n  // Check which controllers are connected.\n  for (var idx = 0; idx \u003c 4; idx++) {\n    final gamepad = Gamepad(idx);\n    final connectionStatus = gamepad.isConnected ? 'connected' : 'disconnected';\n    print('Gamepad $idx is $connectionStatus.');\n  }\n\n  final gamepad = Gamepad(0);\n  if (!gamepad.isConnected) {\n    print('No gamepad connected on slot 0.');\n    return;\n  }\n\n  // Read battery information.\n  final GamepadBatteryInfo(:batteryLevel, :batteryType) =\n      gamepad.gamepadBatteryInfo;\n  print('Battery type is ${batteryType.name}.');\n  print('Battery level is ${batteryLevel.name}.');\n\n  // Test vibration motors.\n  print('Vibrating left motor (half intensity).');\n  gamepad.vibrate(leftMotorSpeed: 32767);\n  sleep(const .new(milliseconds: 1000));\n\n  print('Vibrating right motor (half intensity).');\n  gamepad.vibrate(rightMotorSpeed: 32767);\n  sleep(const .new(milliseconds: 1000));\n\n  print('Vibrating both motors (full intensity).');\n  gamepad.vibrate(leftMotorSpeed: 65535, rightMotorSpeed: 65535);\n  sleep(const .new(milliseconds: 1000));\n\n  print('Turning off vibration.');\n  gamepad.vibrate();\n}\n```\n\n## 🖥️ Flutter Inspector Demo\n\nA full Flutter example app is available in the `example/inspector/` directory.\nIt demonstrates how to build a live gamepad monitor with button highlights,\ntrigger bars, and thumbstick visualisations inside a game loop:\n\n![Gamepad Inspector Demo][demo_image_link]\n\n## 📝 Documentation\n\nFull API reference is available here:\n\n👉 [API Reference][api_reference_link].\n\nAdditional usage examples are located in the [example] directory.\n\n## 🐞 Features and Bugs\n\nIf you encounter bugs or need additional functionality, please\n[file an issue][issue_tracker_link].\n\n[ci_badge]: https://github.com/halildurmus/win32_gamepad/actions/workflows/win32_gamepad.yml/badge.svg\n[ci_link]: https://github.com/halildurmus/win32_gamepad/actions/workflows/win32_gamepad.yml\n[demo_image_link]: https://raw.githubusercontent.com/halildurmus/win32_gamepad/main/screenshots/demo.png\n[issue_tracker_link]: https://github.com/halildurmus/win32_gamepad/issues\n[language_badge]: https://img.shields.io/badge/language-Dart-blue.svg\n[language_link]: https://dart.dev\n[license_badge]: https://img.shields.io/github/license/halildurmus/win32_gamepad?color=blue\n[license_link]: https://opensource.org/licenses/BSD-3-Clause\n[package_badge]: https://img.shields.io/pub/v/win32_gamepad.svg\n[package_link]: https://pub.dev/packages/win32_gamepad\n[publisher_badge]: https://img.shields.io/pub/publisher/win32_gamepad.svg\n[publisher_link]: https://pub.dev/publishers/halildurmus.dev\n[state_class_link]: https://pub.dev/documentation/win32_gamepad/latest/win32_gamepad/GamepadState-class.html\n[update_state_method_link]: https://pub.dev/documentation/win32_gamepad/latest/win32_gamepad/Gamepad/updateState.html\n[vibrate_method_link]: https://pub.dev/documentation/win32_gamepad/latest/win32_gamepad/Gamepad/vibrate.html\n[win32_pub_dev_link]: https://pub.dev/packages/win32\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalildurmus%2Fwin32_gamepad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalildurmus%2Fwin32_gamepad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalildurmus%2Fwin32_gamepad/lists"}