One Controller

Magisk KSU APatch

Connect a DualSense to Android and the buttons often fire wrong actions. Plug in an Xbox controller and the triggers might not register as analog axes at all. The root cause is almost always a missing or incorrect .kl (Key Layout) file. One Controller by Electric1447 fixes this in one flash — installing meticulously crafted, community-tested keylayout files for over ten of the most popular game controllers, applied systemlessly via Magisk so your original system partition is never touched.

Download via Internet Archive

The module ZIP is hosted on Internet Archive. Click the button to download the flashable OneController.zip and install it via Magisk, KernelSU, APatch, or Recovery.

What Gets Fixed

A single module that installs correct keylayout files for every major controller platform — solving wrong button mappings at the Android system level.

Correct Button Mapping

Each .kl file precisely maps every physical button's Linux scan code to the correct Android key code — ensuring Cross maps to BUTTON_A, Circle to BUTTON_B, triggers to LTRIGGER/RTRIGGER axes, and thumbstick clicks to BUTTON_THUMBL/THUMBR as standard.

Analog Axis Fix

Without a proper KL file, analog axes (thumbsticks, triggers) often report as digital buttons or bind to wrong Android axis codes. One Controller maps all axes correctly — including the D-Pad HAT (HAT_X/HAT_Y) for DualShock controllers that report it as an axis rather than individual buttons.

Multi-Platform Coverage

A single module covers PlayStation (DS2 through DualSense), Xbox (360 through Series X|S), Nintendo (Switch Pro Controller), and third-party controllers (Nacon REVOLUTION PRO, Zeemote SteelSeries FREE) — no need to hunt for individual KL files per controller.

USB & Bluetooth

KL files are matched by USB Vendor ID and Product ID — the same identifiers are used for both wired USB and Bluetooth connections. The same KL file fixes mappings whether your controller is plugged in via cable or paired wirelessly.

Systemless Install

KL files are placed in the Magisk systemless overlay at /system/usr/keylayout/ — no modification to the actual system partition. Disabling or removing the module in Magisk Manager instantly reverts to stock keylayout behavior without any trace left behind.

Community-Tested Mappings

Each KL file was contributed or validated by dedicated community members with physical access to the specific controller — including DS4 layouts verified by JaqFb and KeiranGinge, and Xbox Series X|S added by RuiGuilherme after hands-on testing.

How Android .kl Files Work

When you connect a USB or Bluetooth game controller to Android, the Linux kernel driver identifies it by its USB Vendor ID and Product ID — for example, the DualSense reports Vendor_054c Product_0ce6 (Sony, DualSense). Android's input system then looks for a matching Key Layout file at /system/usr/keylayout/Vendor_054c_Product_0ce6.kl. If none is found, it falls back to a generic layout that frequently maps buttons incorrectly.

A .kl file is a plain text file containing key and axis declarations. Each key line maps a Linux input scan code (a hexadecimal number like 0x131) to an Android key code name (like BUTTON_A). Each axis line maps a Linux axis code (like 0x00) to an Android axis name (like X for the left thumbstick). Here is an excerpt from the DualSense KL file included in One Controller:

# Sony PlayStation DualSense (Vendor_054c_Product_0ce6.kl)
# Button mappings
key 0x130 BUTTON_X # Square
key 0x131 BUTTON_A # Cross
key 0x132 BUTTON_B # Circle
key 0x133 BUTTON_Y # Triangle
# Analog axis mappings
axis 0x00 X # Left stick horizontal
axis 0x03 LTRIGGER # L2 trigger analog
axis 0x10 HAT_X # D-Pad horizontal

Once the correct KL file is in place, every game and app that reads standard Android gamepad input sees the controller exactly as intended — buttons fire the right actions, triggers respond with full analog range, and the D-Pad works as directional input rather than misfiring buttons.

Supported Controllers

PlayStation

DualShock 2
PS2 controller via USB adapter
DualShock 3
PS3 controller, USB & Bluetooth
DualShock 4
PS4 controller — note: BT may have delay
DualSense
PS5 controller, USB & Bluetooth

Xbox

Xbox 360
Wired & wireless via receiver
Xbox One
USB & Bluetooth
Xbox One S
USB & Bluetooth
Xbox Series X|S
USB & Bluetooth

Nintendo

Switch Pro Controller
KL file included — not tested yet by author

Third-Party

Nacon REVOLUTION PRO
Pro tournament controller
Zeemote SteelSeries FREE
Compact mobile Bluetooth gamepad

Frequently Asked Questions

One Controller is a Magisk module by Electric1447 that installs device-specific .kl (Key Layout) files into the Android system for popular game controllers. Without these files, button presses from PlayStation, Xbox, and other controllers may be mapped incorrectly or not recognized at all in games and apps.

A .kl (Key Layout) file maps the raw Linux input scan codes reported by a USB or Bluetooth device to Android key codes. Without a controller-specific .kl file at /system/usr/keylayout/, Android falls back to a generic mapping that often gets buttons wrong — for example, trigger axes may not work at all, or the Cross button may fire an incorrect action.

One Controller fixes the system-level key mapping — the layer that translates physical button presses into Android events. Any game that reads standard Android gamepad input will recognize the controller correctly. Games with their own internal input systems may still require in-game configuration, but the system-level mapping will be correct.

This is a known issue unrelated to the module. High input delay when connecting the DualShock 4 via Bluetooth is a hardware-level characteristic of the DS4 on Android. The module only fixes button mapping, not connection latency. Using a USB cable eliminates this delay entirely.

One Controller is not compatible with MIUI 10. This is a known limitation due to how MIUI 10 handles input device initialization. Other MIUI versions and all AOSP-based custom ROMs are unaffected and fully supported.

Credits & Contributors

JaqFb
DualShock 4 keylayout files
KeiranGinge
DualShock 4 button mappings
djsmax
Numerous fixes and improvements across multiple controllers
Black-Seraph
Switch Pro Controller keylayout (CleanRom / GPD XD+)
MattMasc
DualShock 2 keylayout file
RuiGuilherme
Xbox Series X|S keylayout file

Module Info

  • Module By
    Electric1447
  • Source Code View Repository
  • Tags
    #One Controller #Game Controller #Keylayout #DualShock #DualSense #Xbox #Magisk Module #Electric1447 #Gamepad Fix
  • Requirement
    Magisk KernelSU APatch
  • Latest Update