[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-26。"],[],[],null,["Game Controller Library\nPart of [Android Game Development Kit](/games/agdk/overview).\n\nThe Game Controller library, also known as Paddleboat, helps you implement robust support\nfor game controllers. The library provides the following:\n\n- Callbacks for detecting controller connections and disconnections\n- Controller device information, including button style and layout\n- Controller input data, standardized around modern dual-stick controller designs\n- Extended features on supported controllers, including vibration, lights, motion axis data, and battery status\n- Ability to read input from virtual and physical mouse devices\n- Ability to specify custom controller mapping data for particular devices\n\nCompatibility requirements\n\nThe Game Controller library has minimum compatibility requirements of:\n\n- Android 4.4 (API level 19) or higher\n- [Android NDK](/ndk) version 21 or higher\n\nIntegrate\n\nThe Game Controller library is distributed in two formats: As a [Jetpack](/jetpack)\nlibrary for games using a Gradle-based build system (including Android Studio),\nand as discrete files for games using custom build systems.\n\nFor a sample that integrates the Game Controller library, see the\n[games-samples repository](https://github.com/android/games-samples).\n\nJetpack library\n\nThe [Jetpack Android Games](/jetpack/androidx/releases/games) page has\nintegration instructions to add the Game Controller library dependency to your\ngame's `build.gradle` file.\n\nThe Jetpack library release of Game Controller is a static\nlibrary built against the C++ runtime shared library.\n\nAfter updating your `build.gradle` file, you will need to add the following\nline to your game's main `CMakeLists.txt` file: \n\n find_package(games-controller REQUIRED CONFIG)\n\nYou will also need to add the following entry to the list of libraries\nin the `target_link_libraries` command of your game's main shared\nlibrary: \n\n games-controller::paddleboat_static\n\nDiscrete files\n\nThe `.zip` archive distribution of the Android Game Development Kit includes\nheader and library files for the Game Controller library. The following files\nmust be included in your project to use the Game Controller library:\n\n- The `classes.jar` file containing the Dalvik bytecode portions of the Game Controller library. This file is located at `libs/classes.jar`\n- The `paddleboat.h` interface header file. This file is located at `include/paddleboat/paddleboat.h`\n- Either the `libpaddleboat.so` shared library file or the `libpaddleboat-static.a` static library file. These files are found in the build configuration subdirectories under the `libs` directory.\n\nThe build configuration subdirectories under the root `libs` directory are\ncategorized by:\n\n- ABI architecture\n- Minimum Android API level\n- Android NDK version\n- C++ runtime library version\n- Release or debug build configuration\n\nAs an example, the `arm64-v8a_API16_NDK21_cpp_shared_Release` subdirectory\ncontains library files for:\n\n- ARM 64-bit ABI\n- Minimum API level 16\n- Built against NDK version 21\n- Built against shared library version of C++ runtime\n- Release build configuration\n\nThe `libpaddleboat_static.a` file is located directly in the subdirectory. The\n`libpaddleboat.so` file is located at `lib/paddleboat/` within the subdirectory.\n\nNext steps\n\nSee the following guides to continue integrating the Game Controller library into your game:\n\n- [Use the Game Controller library](/games/sdk/game-controller/controller)\n- [Add mouse support](/games/sdk/game-controller/mouse)\n- [Add custom controller device mappings](/games/sdk/game-controller/custom-mapping)"]]