I owe a which doesn't have a 3.5mm headphone jack. Instead, it use my headphones with a USB-C to 3.5mm adapter. While the speakers and the mic work, the buttons don't. They're assigned incorrect functions. Play/Pause
works, but Vol+
decreases the volume and Vol-
selects things on the screen.
I wanna change this behaviour. Using the app "KeyEvent Display", I figured out that
Vol+
triggers "linux key code number" 114Vol-
triggers "linux key code number" 259Play/Pause
triggers "linux key code number" 226
Using the android documentation, I figured out that the buttons are all managed by /system/usr/keylayout/Generic.kl
. I could get the expected behaviour by changing the following lines:
key 114 VOLUME_UP
key 226 HEADSETHOOK
key 259 VOLUME_DOWN
However, this interfered with the function of other buttons of my phone!
That's why I want to create a device-specific config file. For this, I need either the device name or the vendor and product IDs. (As explained in the android documentation.) However, I don't know to get those. The app "USB Device Info" didn't show any connected device. This is the shortened output of cat /proc/bus/input/devices
:
I: Bus=0000 Vendor=0000 Product=0003 Version=2061
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
Full output: here.
Relevant output of "Under the Hood": pastebin.com/kDeBNS0H
I made a file containing the above code and tried giving it the following file names (rebooting every time): Vendor_0000_Product_0003.kl
, Vendor_0000_Product_0000.kl
, Vendor_0001_Product_0001.kl
, but nothing worked.
Can anyone help me?