From c655f5cc9c4110d4ff118327c52c5c1d4841eeb5 Mon Sep 17 00:00:00 2001 From: Jakob Hauser Date: Thu, 2 Dec 2021 02:30:32 +0100 Subject: [PATCH] samsung-a3|a5|klte|serranove: remap left touch key (MR 2718) Remapping the left key of tm2-touchkey to KEY_MENU. The KEY_APPSELECT, which is set by the device tree, is not available in the postmarketOS UIs. In X11 UIs this is due to keycode limitation to 8 bit. In Wayland UIs the keycodes don't have this limitation but xkb keycodes higher 255 are not processed correctly by several software packages. It still makes sense to keep KEY_APPSELECT in the device tree because this is the correct mapping intended by the manufacturers when running the kernel on Android. --- .../device-samsung-a3/20-tm2-touchkey-input.rules | 2 ++ device/community/device-samsung-a3/APKBUILD | 11 +++++++++-- .../device-samsung-a5/20-tm2-touchkey-input.rules | 2 ++ device/community/device-samsung-a5/APKBUILD | 10 ++++++++-- .../20-tm2-touchkey-input.rules | 2 ++ device/community/device-samsung-serranove/APKBUILD | 11 +++++++++-- .../device-samsung-klte/20-tm2-touchkey-input.rules | 2 ++ device/testing/device-samsung-klte/APKBUILD | 8 ++++++-- 8 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 device/community/device-samsung-a3/20-tm2-touchkey-input.rules create mode 100644 device/community/device-samsung-a5/20-tm2-touchkey-input.rules create mode 100644 device/community/device-samsung-serranove/20-tm2-touchkey-input.rules create mode 100644 device/testing/device-samsung-klte/20-tm2-touchkey-input.rules diff --git a/device/community/device-samsung-a3/20-tm2-touchkey-input.rules b/device/community/device-samsung-a3/20-tm2-touchkey-input.rules new file mode 100644 index 000000000..265ccf11c --- /dev/null +++ b/device/community/device-samsung-a3/20-tm2-touchkey-input.rules @@ -0,0 +1,2 @@ +# remap the left key of tm2-touchkey to KEY_MENU +SUBSYSTEM=="input", KERNEL=="event*", DRIVERS=="tm2-touchkey", ENV{KEYBOARD_KEY_00}="menu", RUN{builtin}+="keyboard" diff --git a/device/community/device-samsung-a3/APKBUILD b/device/community/device-samsung-a3/APKBUILD index 02a7c7206..6aa08255a 100644 --- a/device/community/device-samsung-a3/APKBUILD +++ b/device/community/device-samsung-a3/APKBUILD @@ -4,7 +4,7 @@ # Co-Maintainer: Minecrell pkgname=device-samsung-a3 pkgdesc="Samsung Galaxy A3 (2015)" -pkgver=7 +pkgver=8 pkgrel=0 url="https://postmarketos.org" license="MIT" @@ -13,7 +13,11 @@ options="!check !archcheck" depends="postmarketos-base mkbootimg linux-postmarketos-qcom-msm8916 soc-qcom-msm8916 soc-qcom-msm8916-rproc" makedepends="devicepkg-dev" -source="deviceinfo rootston.ini" +source=" + 20-tm2-touchkey-input.rules + deviceinfo + rootston.ini +" subpackages=" $pkgname-nonfree-firmware:nonfree_firmware $pkgname-phosh @@ -32,6 +36,8 @@ build() { package() { devicepkg_package $startdir $pkgname + install -Dm644 "$srcdir"/20-tm2-touchkey-input.rules \ + "$pkgdir"/lib/udev/rules.d/20-tm2-touchkey-input.rules } nonfree_firmware() { @@ -53,6 +59,7 @@ phosh() { } sha512sums=" +5a91ca375652bc9d2af90db4f446176a4fd43b5c924362219f6bf35e76de818cb4ecce105ee56b4511c3c0882bd055615f409516fade6dfcd30642cc147c1c5a 20-tm2-touchkey-input.rules dac014f2ebc1c461e43917fcfc020675c10ac39e17b83b0e0e2246b159db1f61ce024df21624f2635729f29521b30b4cce29b4451931cb27cf4d0f34b19ec509 deviceinfo f3667b914bb955be9e97db31dc7ed4a7c5d0c369be9549d587bb7208e270590c0c3fa36a0dd997d6f8305c5c9afb3b906423af6ca8724e806f995e61226cfc83 rootston.ini " diff --git a/device/community/device-samsung-a5/20-tm2-touchkey-input.rules b/device/community/device-samsung-a5/20-tm2-touchkey-input.rules new file mode 100644 index 000000000..265ccf11c --- /dev/null +++ b/device/community/device-samsung-a5/20-tm2-touchkey-input.rules @@ -0,0 +1,2 @@ +# remap the left key of tm2-touchkey to KEY_MENU +SUBSYSTEM=="input", KERNEL=="event*", DRIVERS=="tm2-touchkey", ENV{KEYBOARD_KEY_00}="menu", RUN{builtin}+="keyboard" diff --git a/device/community/device-samsung-a5/APKBUILD b/device/community/device-samsung-a5/APKBUILD index e59c77ce7..d50050b73 100644 --- a/device/community/device-samsung-a5/APKBUILD +++ b/device/community/device-samsung-a5/APKBUILD @@ -3,7 +3,7 @@ # Co-Maintainer: Alexey Min pkgname=device-samsung-a5 pkgdesc="Samsung Galaxy A5 (2015)" -pkgver=7 +pkgver=8 pkgrel=0 url="https://postmarketos.org" license="MIT" @@ -12,7 +12,10 @@ options="!check !archcheck" depends="postmarketos-base mkbootimg linux-postmarketos-qcom-msm8916 soc-qcom-msm8916 soc-qcom-msm8916-rproc" makedepends="devicepkg-dev" -source="deviceinfo" +source=" + 20-tm2-touchkey-input.rules + deviceinfo +" subpackages=" $pkgname-nonfree-firmware:nonfree_firmware " @@ -30,6 +33,8 @@ build() { package() { devicepkg_package $startdir $pkgname + install -Dm644 "$srcdir"/20-tm2-touchkey-input.rules \ + "$pkgdir"/lib/udev/rules.d/20-tm2-touchkey-input.rules } nonfree_firmware() { @@ -42,5 +47,6 @@ nonfree_firmware() { } sha512sums=" +5a91ca375652bc9d2af90db4f446176a4fd43b5c924362219f6bf35e76de818cb4ecce105ee56b4511c3c0882bd055615f409516fade6dfcd30642cc147c1c5a 20-tm2-touchkey-input.rules ee496db47c95cb67b502c5f11d7390b679fbc8fc011eab1f9d7639b5df02c01501cb9963f638adaed93e6626a23e15be6d53b093f2b55f7d19108d06277939f7 deviceinfo " diff --git a/device/community/device-samsung-serranove/20-tm2-touchkey-input.rules b/device/community/device-samsung-serranove/20-tm2-touchkey-input.rules new file mode 100644 index 000000000..265ccf11c --- /dev/null +++ b/device/community/device-samsung-serranove/20-tm2-touchkey-input.rules @@ -0,0 +1,2 @@ +# remap the left key of tm2-touchkey to KEY_MENU +SUBSYSTEM=="input", KERNEL=="event*", DRIVERS=="tm2-touchkey", ENV{KEYBOARD_KEY_00}="menu", RUN{builtin}+="keyboard" diff --git a/device/community/device-samsung-serranove/APKBUILD b/device/community/device-samsung-serranove/APKBUILD index c8ed658af..d889773b2 100644 --- a/device/community/device-samsung-serranove/APKBUILD +++ b/device/community/device-samsung-serranove/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Minecrell pkgname=device-samsung-serranove pkgdesc="Samsung Galaxy S4 Mini Value Edition" -pkgver=7 +pkgver=8 pkgrel=0 url="https://postmarketos.org" license="MIT" @@ -11,7 +11,11 @@ options="!check !archcheck" depends="postmarketos-base mkbootimg linux-postmarketos-qcom-msm8916 soc-qcom-msm8916 soc-qcom-msm8916-rproc" makedepends="devicepkg-dev" -source="deviceinfo rootston.ini" +source=" + 20-tm2-touchkey-input.rules + deviceinfo + rootston.ini +" subpackages=" $pkgname-nonfree-firmware:nonfree_firmware $pkgname-phosh @@ -30,6 +34,8 @@ build() { package() { devicepkg_package $startdir $pkgname + install -Dm644 "$srcdir"/20-tm2-touchkey-input.rules \ + "$pkgdir"/lib/udev/rules.d/20-tm2-touchkey-input.rules } nonfree_firmware() { @@ -49,6 +55,7 @@ phosh() { } sha512sums=" +5a91ca375652bc9d2af90db4f446176a4fd43b5c924362219f6bf35e76de818cb4ecce105ee56b4511c3c0882bd055615f409516fade6dfcd30642cc147c1c5a 20-tm2-touchkey-input.rules d666cf805d292d13d9e15a350b203580f016f455dad16cbc4a94471edb145fd464c5ad92a50077995234a9db1322e605e0294a6c5d7342fa6675b1bfec4eb69e deviceinfo 94c866b6583faadc4a96a4d737983ba7838ede52afa5e29e261ef0ad0f2afe29fd3b793c9208ae74c7d48db6b991ad21800b9e457fbba4c69ce9dec2cda268ea rootston.ini " diff --git a/device/testing/device-samsung-klte/20-tm2-touchkey-input.rules b/device/testing/device-samsung-klte/20-tm2-touchkey-input.rules new file mode 100644 index 000000000..265ccf11c --- /dev/null +++ b/device/testing/device-samsung-klte/20-tm2-touchkey-input.rules @@ -0,0 +1,2 @@ +# remap the left key of tm2-touchkey to KEY_MENU +SUBSYSTEM=="input", KERNEL=="event*", DRIVERS=="tm2-touchkey", ENV{KEYBOARD_KEY_00}="menu", RUN{builtin}+="keyboard" diff --git a/device/testing/device-samsung-klte/APKBUILD b/device/testing/device-samsung-klte/APKBUILD index c53f7330b..b3297910e 100644 --- a/device/testing/device-samsung-klte/APKBUILD +++ b/device/testing/device-samsung-klte/APKBUILD @@ -1,8 +1,8 @@ # Reference: pkgname=device-samsung-klte pkgdesc="Samsung Galaxy S5 (G900F)" -pkgver=2 -pkgrel=1 +pkgver=3 +pkgrel=0 url="https://postmarketos.org" license="MIT" arch="armv7" @@ -19,6 +19,7 @@ subpackages=" $pkgname-nonfree-firmware:nonfree_firmware " source=" + 20-tm2-touchkey-input.rules bt-module-deps.conf deviceinfo " @@ -29,6 +30,8 @@ build() { package() { devicepkg_package $startdir $pkgname + install -Dm644 "$srcdir"/20-tm2-touchkey-input.rules \ + "$pkgdir"/lib/udev/rules.d/20-tm2-touchkey-input.rules } nonfree_firmware() { @@ -48,6 +51,7 @@ nonfree_firmware() { } sha512sums=" +5a91ca375652bc9d2af90db4f446176a4fd43b5c924362219f6bf35e76de818cb4ecce105ee56b4511c3c0882bd055615f409516fade6dfcd30642cc147c1c5a 20-tm2-touchkey-input.rules 6cef5f8ae1785ac16e6fe84bfc861ac50cdfb94db35d764f44a25c960e123cb82f6e56f45362a5340c62a3d5ac225f2689afd4f6964cb88305a0892ba44214f0 bt-module-deps.conf ddbf2140fdc4b3c50a78a5c946d2bec75debec68a89bfac6e1ad7b112af7c38e916ac056dbe69e266c229e3543427471375d3f5f362dcf35765e86a6bc0f4024 deviceinfo "