Merge pull request #244 from PeterCxy/patch-unihertz-keylayout
add keylayout for Unihertz devices
This commit is contained in:
commit
9a7fdc991b
4
base.mk
4
base.mk
@ -124,6 +124,10 @@ PRODUCT_COPY_FILES += \
|
|||||||
device/phh/treble/files/daisy-uinput-fpc.kl:system/phh/daisy-uinput-fpc.kl \
|
device/phh/treble/files/daisy-uinput-fpc.kl:system/phh/daisy-uinput-fpc.kl \
|
||||||
device/phh/treble/files/daisy-uinput-goodix.kl:system/phh/daisy-uinput-goodix.kl \
|
device/phh/treble/files/daisy-uinput-goodix.kl:system/phh/daisy-uinput-goodix.kl \
|
||||||
device/phh/treble/files/nubia-nubia_synaptics_dsx.kl:system/phh/nubia-nubia_synaptics_dsx.kl \
|
device/phh/treble/files/nubia-nubia_synaptics_dsx.kl:system/phh/nubia-nubia_synaptics_dsx.kl \
|
||||||
|
device/phh/treble/files/unihertz-mtk-kpd.kl:system/phh/unihertz-mtk-kpd.kl \
|
||||||
|
device/phh/treble/files/unihertz-mtk-tpd.kl:system/phh/unihertz-mtk-tpd.kl \
|
||||||
|
device/phh/treble/files/unihertz-mtk-tpd-kpd.kl:system/phh/unihertz-mtk-tpd-kpd.kl \
|
||||||
|
device/phh/treble/files/unihertz-fingerprint_key.kl:system/phh/unihertz-fingerprint_key.kl \
|
||||||
device/phh/treble/files/zf6-goodixfp.kl:system/phh/zf6-goodixfp.kl \
|
device/phh/treble/files/zf6-goodixfp.kl:system/phh/zf6-goodixfp.kl \
|
||||||
device/phh/treble/files/zf6-googlekey_input.kl:system/phh/zf6-googlekey_input.kl \
|
device/phh/treble/files/zf6-googlekey_input.kl:system/phh/zf6-googlekey_input.kl \
|
||||||
|
|
||||||
|
3
files/unihertz-fingerprint_key.kl
Normal file
3
files/unihertz-fingerprint_key.kl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Key layout for Unihertz devices with fingerprint sensor
|
||||||
|
# For Atom {,L,XL}: fingerprint sensor as home
|
||||||
|
key 172 HOME VIRTUAL
|
13
files/unihertz-mtk-kpd.kl
Normal file
13
files/unihertz-mtk-kpd.kl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Keylayout for Unihertz devices with a dedicated PTT button
|
||||||
|
# Volume buttons
|
||||||
|
key 115 VOLUME_UP
|
||||||
|
key 114 VOLUME_DOWN
|
||||||
|
|
||||||
|
# Power button
|
||||||
|
key 116 POWER
|
||||||
|
|
||||||
|
# PTT - Remap to camera by default
|
||||||
|
# CAMERA is delivered to apps, so remapping via
|
||||||
|
# third-party apps is possible
|
||||||
|
key 249 CAMERA
|
||||||
|
key 250 CAMERA
|
6
files/unihertz-mtk-tpd-kpd.kl
Normal file
6
files/unihertz-mtk-tpd-kpd.kl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Keylayout for Unihertz devices with capacitive keys
|
||||||
|
# Capacitive navigation
|
||||||
|
key 172 HOME VIRTUAL
|
||||||
|
key 580 APP_SWITCH VIRTUAL
|
||||||
|
key 158 BACK VIRTUAL
|
||||||
|
|
6
files/unihertz-mtk-tpd.kl
Normal file
6
files/unihertz-mtk-tpd.kl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Keylayout for Unihertz devices with capacitive keys
|
||||||
|
# Capacitive navigation
|
||||||
|
key 172 HOME VIRTUAL
|
||||||
|
key 580 APP_SWITCH VIRTUAL
|
||||||
|
key 158 BACK VIRTUAL
|
||||||
|
|
12
rw-system.sh
12
rw-system.sh
@ -240,6 +240,18 @@ changeKeylayout() {
|
|||||||
changed=true
|
changed=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if getprop ro.vendor.build.fingerprint | grep -q -e Unihertz/;then
|
||||||
|
cp /system/phh/unihertz-mtk-kpd.kl /mnt/phh/keylayout/mtk-kpd.kl
|
||||||
|
cp /system/phh/unihertz-mtk-tpd.kl /mnt/phh/keylayout/mtk-tpd.kl
|
||||||
|
cp /system/phh/unihertz-mtk-tpd-kpd.kl /mnt/phh/keylayout/mtk-tpd-kpd.kl
|
||||||
|
cp /system/phh/unihertz-fingerprint_key.kl /mnt/phh/keylayout/fingerprint_key.kl
|
||||||
|
chmod 0644 /mnt/phh/keylayout/mtk-kpd.kl
|
||||||
|
chmod 0644 /mnt/phh/keylayout/mtk-tpd.kl
|
||||||
|
chmod 0644 /mnt/phh/keylayout/mtk-tpd-kpd.kl
|
||||||
|
chmod 0644 /mnt/phh/keylayout/fingerprint_key.kl
|
||||||
|
changed=true
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$changed" = true ]; then
|
if [ "$changed" = true ]; then
|
||||||
mount -o bind /mnt/phh/keylayout /system/usr/keylayout
|
mount -o bind /mnt/phh/keylayout /system/usr/keylayout
|
||||||
restorecon -R /system/usr/keylayout
|
restorecon -R /system/usr/keylayout
|
||||||
|
Loading…
Reference in New Issue
Block a user