How do I map a joypad (specifically the HAT switch/DPad) axis to a button with a key-layout file in /system/usr/keylayout/
? I currently have this line in the appropriate file: axis 0x10 split 0x7f BUTTON_L1 BUTTON_R1
.
I'll explain the line token by token. First token refers to the input type. axis
means I'm binding an axis.
Second token is the axis ID. The axis I want to remap is 0x10
.
The Android developer's wiki page concerning key-layout files mention you can split an input axis into two outputs with split
so I'm using it. The split is at the value immediately following split
, in this case 0x7f
.
Input values below the split threshold map as the 1st token after the split threshold token. Here it is BUTTON_L1
.
Input values above the split threshold map as the 2nd token after the split threshold token. Here it is BUTTON_R1
.
However, when I use the line metioned above the axis does not map to anything anymore. Are you able to map device axes to Android buttons in the first place? If so, what is the proper syntax for it?