Remapping of hardware buttons

Hello sailors, i am using xa2, x10+ and xz2c. On the XA2 with screen protector it is really a pain to swipe from the edge of the screen to show the apps overview. It would be really nice to show the desktop with the camera button on the side! Can someone give me a hint, how to do this? It should be really easy, when you know where to look at…


ok, found out that KEY_CAMERA_FOCUS is 0x210 and KEY_CAMERA_SNAPSHOT is 0x2fe. anybody knows how to add/modify actions triggered, for example show task switcher? also want to mention mce-tools and sf-button-monitor (which is not working for me)…
edit: found the place for adding the action at /usr/share/lipstick-jolla-home-qt5/main.qml, but still not knowing the command to show home/desktop

1 Like

There is a not really used or actively maintained home key support feature in mce+lipstick that just might still work for your purposes… requires root, but something like:

printf "[EVDEV]\nKEY_CAMERA_SNAPSHOT=KEY_HOME\n" > /etc/mce/99-camera-key-hack.ini
systemctl restart mce

After which mce treats camera key as home key → when pressed mce informs lipstick which then backgrounds the currently active app.

(It should also power up display if blanked, but that bit does not work well with on-demand proximity sensor use that is used e.g. in xa2. And as that remapping is for mce only, ui is still going to get camera key events - which might produce interesting situations e.g. with camera application.)

And in case you wish to return back to normal camera key behaviour:

rm /etc/mce/99-camera-key-hack.ini
systemctl restart mce

i think best solution would be to add: onPress: { Lipstick.compositor.goToSwitcher(false)} and maybe toggle torchlight (via dbus) on double-press to the ShutterKey section of main.qml

Thank you.
But which main.qml ?

in /usr/share/lipstick-jolla-home-qt5/, but phone may become unbootable, so be carefull (backup, ssh, no reboot until fix)!

1 Like