[
    {
        "role": "user",
        "content": "how%20can%20i%20list%20which%20game%20controllers%20are%20attached%20and%20on%3F"
    },
    {
        "role": "assistant",
        "content": "It depends on what environment you're using (Windows, Linux, or writing code), and whether you want a GUI or command-line tool. Here are methods for checking which game controllers are connected right now, and whether they\u2019re \u201con\u201d (powered / active), broken down by platform / use-case:\n\n---\n\n## Windows\n\n### GUI Methods\n\n1. **Game Controllers (joy.cpl)**\n   - Press `Win + R`, type `joy.cpl` and hit Enter.  \n   - The \u201cGame Controllers\u201d window appears, showing connected controllers and their status. ([kanuan.github.io](https://kanuan.github.io/DS4WSite/troubleshooting/controllers-check/?utm_source=openai))\n\n2. **Devices & Printers / Bluetooth & Other Devices**\n   - In Settings \u2192 \u201cBluetooth & Other Devices\u201d, or via Control Panel \u2192 Devices, you\u2019ll see controllers that are paired or plugged in. ([kanuan.github.io](https://kanuan.github.io/DS4WSite/troubleshooting/controllers-check/?utm_source=openai))\n\n3. **Device Manager**\n   - Right-click Start \u2192 Device Manager.  \n   - Look under \u201cHuman Interface Devices\u201d (HID) or sometimes under \u201cXbox Peripherals\u201d.  \n   - Find entries like \u201cHID-compliant game controller\u201d, \u201cXbox Wireless Controller\u201d, etc. If the device is powered on and connected, it should show up here. ([kanuan.github.io](https://kanuan.github.io/DS4WSite/troubleshooting/controllers-check/?utm_source=openai))\n\n### Command-Line / Programming\n\n- Windows doesn\u2019t have a built-in command-line tool that universally lists only *active* game controllers in the same way Linux does.  \n- Some apps can use APIs like **Windows.Gaming.Input** to programmatically enumerate active controllers via vendor-ID / product-ID. ([learn.microsoft.com](https://learn.microsoft.com/en-us/windows/uwp/gaming/registry-data-for-game-controllers?utm_source=openai))\n\n---\n\n## Linux\n\n### Command-Line\n\n1. **lsusb**\n   - Run `lsusb` to show all USB-devices. Controllers connected via USB will often show up here. However, this doesn\u2019t always tell you whether they\u2019re active or idle. ([dca.cusat.ac.in](https://dca.cusat.ac.in/Library/uploads/8/6/3/7/86371954/linux-journal-2015-12.pdf?utm_source=openai))\n\n2. **evdev / joysticks**\n   - Use tools like `jstest-gtk` to list joystick devices and test their input. If a controller is connected and recognized by the kernel, it will show up. ([reddit.com](https://www.reddit.com/r/linux_gaming/comments/1bm5ydu?utm_source=openai))  \n   - `ls /dev/input` and check for devices named like `js0`, `eventX` etc. (depending on your distro) for active joystick/gamepad devices.\n\n3. **xinput**\n   - Run `xinput list` to see input devices recognized by X. Gamepads or similar may show up among them. ([reddit.com](https://www.reddit.com/r/linux4noobs/comments/1rkf586/does_linux_not_support_x_input_for_controllers/?utm_source=openai))\n\n### Programming / Libraries\n\n- Libraries like **pyglet** provide ways to check connected controllers:\n  - `pyglet.input.get_controllers()` lists all currently connected controllers. ([pyglet.readthedocs.io](https://pyglet.readthedocs.io/en/development/programming_guide/input.html?utm_source=openai))  \n  - They also support events `on_connect` / `on_disconnect` to detect when controllers are turned on/off or plugged/unplugged. ([pyglet.readthedocs.io](https://pyglet.readthedocs.io/en/development/programming_guide/input.html?utm_source=openai))\n\n---\n\n## Cross-Platform / Game Engines / Code\n\nIf you're writing a game or application and want to check for controllers programmatically:\n\n- Use an abstraction library / game framework (SDL, Unity, Unreal, etc.) which often has functions like \u201cget connected gamepads\u201d or \u201cdetect gamepad count\u201d.\n- In Python, as mentioned, **pyglet** has `get_controllers()`. In C/C++ you can use SDL\u2019s `SDL_NumJoysticks()` + `SDL_JoystickOpen()` to find and interact with them.\n- Use OS-specific APIs: on Windows for example `Windows.Gaming.Input.Gamepad.Gamepads` (or similar) to enumerate connected gamepads. ([learn.microsoft.com](https://learn.microsoft.com/en-us/windows/uwp/gaming/registry-data-for-game-controllers?utm_source=openai))\n\n---\n\nIf you tell me **which OS or language/framework** you're using, I can give you exact commands or code snippets to list controllers that are both connected *and* active. Do you want the method for your system?"
    }
]