[Galaxy S III Original Android Development] curiousrom:
Swap or Switch Back & Recents Buttons Functions

I actually swapped the Back & Recents Buttons on the soft Navigation bar of my LOS 13.0 tablet to make it work like the S3 that I have been using for years but tested this for you. I may actually try to get used to the change.

If you have root enabled you have to edit as text /system/usr/keylayout/sec_touchkey.kl and replace ONLY 139 with 158 and 158 with 139, save and reboot to swap the Back & Recents (also called Menu or App Switcher) capacitive buttons functions on the S3 i9300 running LineageOS 14.1. Original content of the sec_touchkey.kl file:

key 158 BACK	VIRTUAL
key 139 APP_SWITCH	VIRTUAL

See this Stackexchange post for detailed instructions which also links to the official geeky https://source.android.com/devices/input/key-layout-files

***

Switch Back & Recents Buttons using a Flashable .Zip Without Root

I created & tested a TWRP flashable Buttons_Back_Recents_Swap_curiousrom.zip using ZIPme (see XDA thread, Thanks [MENTION=5161712]eduds[/MENTION]) that replaces the sec_touchkey.kl file with a modified one as described above & an other one to return to Stock so they can be used if you don't have root enabled or don't want to edit manually. (attachments)

This mod via file editing or flashing the .zip did not survive an update made with the Lineage Updater & have to be re-flashed afterwards.

The advantage of this method is that it does not use any background resources contrary to the apps described below.

The modifications made with > Settings > Buttons > Recents button > Long press action still works.

Settings > Developer options > scroll all the way down > enable Kill the foreground app by long-pressing the Back button still works which I like very much.

***

Swap Back & Recents Buttons using an App

The free app Button Mapper by Inter-Soft works for switching (swapping) the Back & Recents capacitive buttons functions on the S3 Lineage OS 14.1. Long-press to kill on the modified Recents > to Back did not work but Screen Off works. I did not test all the different buttons tweaking options. (screenshot)

Users of this app in Play Store complain about an excess of ads but I don't see any thanks to the system wide adblocker AdAway.

You have to grant all permissions asked by the app (Accessibility Service & Device Administrator) as well as in > Privacy Guard.

After rebooting and checking in Settings > Developer Options > Running services > Button Mapper will settle down to using about 8 MB of RAM after a while & 40-64 MB (screenshot) when using the app to tweak which will go down after a reboot.

In Privacy Guard > Button Mapper > I tried disabling Start at boot & rebooted and the RAM usage went down to 1.8 MB with a service running in the background & the Back & Recents buttons swap was still working. I did not test al the other tweaks to see if they stick even with the app not running in the background.

The Button Mapper by flar2 requieres the pro (paid) version to enable "support for back button, recent apps button". I did not try it.

Edit: After testing Button Mapper by flar2 on S3 i9300 running LineageOS 14.1 I can confirm that contrary to the current Play Store app's description the Back & Recents buttons functions are swappable & Double tap & Long press actions are customizable & supported in the free version.

This Button Mapper by flar2 is better than the Button Mapper by Inter-Soft described above as it does not collect data as observed using a network connections monitor.

Both work with similar results but I prefer the flashable .zip method to keep the system clean with a maximum of free RAM & zero CPU usage.

As usual please report back if it works for you or not & and if you tested more tweaks in the app. :cool:

***