fefb606912
This adds a way to handle physical events like keypad slide switch, screen lock, camera lid, and others. This uses acpid from busybox (I was wrong about the real acpid package), and anl acpi.map file to map events to 'scripts'. The scripts are symlinked to /etc/acpi/handler.sh, automatically by the new post-install script, where they are handled based on which script was called. This allows for easily adding whatever is necessary for #178. If this PR is merged, I will create a new wiki page detailing how others can use this framework on other devices. There's an issue with Busybox's acpid, where it is unable to detect new devices added after the daemon loads. This is the case on the N900, where openrc starts acpid well before the kernel is done modprobing drivers (e.g. gpio_keys), so it's necessary to restart the acpid daemon after some time to 'load' the new devices.
30 lines
1.1 KiB
Text
30 lines
1.1 KiB
Text
# FORMAT: "<EV_XXX>" <type> "<input.h name>" <keycode> <value> <script under /etc/acpi>
|
|
# hint: "evtest /dev/input/eventX" is very helpful!
|
|
|
|
"EV_SW" 0x05 "SW_CAMERA_LENS_COVER" 9 1 CAM_LID_OPEN
|
|
"EV_SW" 0x05 "SW_CAMERA_LENS_COVER" 9 0 CAM_LID_CLOSE
|
|
|
|
"EV_SW" 0x05 "SW_KEYPAD_SLIDE" 10 1 KP_SLIDE_OPEN
|
|
"EV_SW" 0x05 "SW_KEYPAD_SLIDE" 10 0 KP_SLIDE_CLOSE
|
|
|
|
"EV_SW" 0x05 "SW_FRONT_PROXIMITY" 11 1 FRNT_PRXY_ON
|
|
"EV_SW" 0x05 "SW_FRONT_PROXIMITY" 11 0 FRNT_PRXY_OFF
|
|
|
|
"EV_KEY" 0x01 "KEY_SCREENLOCK" 152 0 SCRNLCK_UP
|
|
"EV_KEY" 0x01 "KEY_SCREENLOCK" 152 1 SCRNLCK_DWN
|
|
|
|
"EV_KEY" 0x01 "KEY_CAMERA" 212 0 CAM_BTN_UP
|
|
"EV_KEY" 0x01 "KEY_CAMERA" 212 1 CAM_BTN_DWN
|
|
|
|
"EV_KEY" 0x01 "KEY_CAMERA_FOCUS" 528 0 CAM_FOCUS_UP
|
|
"EV_KEY" 0x01 "KEY_CAMERA_FOCUS" 528 1 CAM_FOCUS_DWN
|
|
|
|
"EV_KEY" 0x01 "KEY_POWER" 116 0 PWR_BTN_UP
|
|
"EV_KEY" 0x01 "KEY_POWER" 116 1 PWR_BTN_DWN
|
|
|
|
"EV_SW" 0x05 "SW_HEADPHONE_INSERT" 2 1 HEADPHONE_INSERT
|
|
"EV_SW" 0x05 "SW_MICROPHONE_INSERT" 2 1 MICROPHONE_INSERT
|
|
"EV_SW" 0x05 "SW_VIDEOOUT_INSERT" 2 1 VIDEOOUT_INSERT
|
|
|
|
"EV_KEY" 0x01 "KEY_VOLUMEUP" 66 1 VOL_UP
|
|
"EV_KEY" 0x01 "KEY_VOLUMEDOWN" 65 1 VOL_DWN
|