OSDN Git Service

init.x86.rc: add ctrl-alt-del service
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 20 Nov 2017 10:44:40 +0000 (18:44 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 21 Nov 2017 08:52:41 +0000 (16:52 +0800)
Use the keychord driver to trap ctrl-alt-del event and transform it
to a long-press power key.

Unfortunately init only supports one keycodes set. So only the set
is supported: right ctrl (97), right alt (100) and delete (111).
The other combinations will be trapped and handled by init directly.

init.x86.rc

index bd6d033..7169bd6 100644 (file)
@@ -83,6 +83,11 @@ service tablet-mode /system/bin/tablet-mode
     disabled
     oneshot
 
+service ctrl-alt-del /system/bin/input keyevent --longpress POWER
+    disabled
+    oneshot
+    keycodes 97 100 111
+
 on property:system_init.startsurfaceflinger=0
     # disable cursor blinking
     write /dev/tty0 "\e[?17;0;0c"