How to handle laptophotkeys in Linux

Source: Internet
Author: User
Linux system handles laptophotkeys-general Linux technology-Linux programming and kernel information. The following is a detailed description. I have been studying for the past few days. To make the hotkey on my notebook fully work properly, it takes many aspects to work together.

1. hardware vendors support linux in bios. After the machine is started, use dmesg | grep-I acpi to find two or three errors during load acpi. I think this will cause some hotkeys in the system to be unable to catch the keys with those acpi_listen or xev, that is, no corresponding keycode is output. This requires dsdt modification. Hardware vendors do not support it. They only need to do some hacking work. If they have worked on embedded driver development, they should all talk about it. Risks can be dealt with care.

2. linux kernel's support for ACPI. Now all kinds of laptops, such as ibm, sony, asus, dell, and hp, have their corresponding _ acpi projects, which will also be integrated into the kernel, for example, debian, linux-image-2.6.21-2-686 has ibm_acpi, asus_acpi, toshiba_acpi, but no sony_acpi, these are various laptop acpi driver. I use asus. In fact, the kernel is provided by the acp4asus project. I have to stop the built-in kernel to download and compile the new acpi4asus driver. ACPI should manage hotkeys, screen brightness, fan, cpu speedstep, and cpu temp.

3. With the driver, only basic support is provided. You also need a daemon program running in the user space to obtain the key event, such as the current acpid, acpi-support provides scripts related to post-processing of acpid response events. This mechanism is like the key/value pair of event/action. The problem is that the new acpi driver will cause the acpid to be unavailable, because the driver that comes with the kernel may write the information to/proc/acpi, and the new driver will put it under/sys, in this way, the acpid will not be able to process key events (the acpi-support scripts are not supported because they are for/proc ). For example, the new acpi4asus (0.42, before 0.40) provides its own daemon, called asus_acpid. In addition, there is a conflict between different acpid daemon. For example, they all need to use/var/run/acpid. socket. In my current system, the acpid tube Fn + F1/F5/F7, while the asus_acpid tube Fn + F3/F4/F9/F10/F11/F12.

4. After responding to the button event, it is completely self-configured. For example, you can choose not to set Fn + F1 to sleep. However, the implementation of specific functions is related to specific drivers/tools, for example,

Fn + f1, control sleep, implemented through suspend2ram and suspend2disk.

Fn + F2: If you only start and stop wireless LEDs, It is very simple, because this is in the Power Management, if you need to control the wireless driver, you need to establish a connection with ipw3945, this work is not easy in apcid because it does not know what the specific wireless driver is. In windows, asus provides atk0100 drivers and wireless drivers. Naturally, they can be easily integrated;

Fn + f3/f4 is completely defined by myself. On my machine, iceweasel and icedove are started. It's easy to write iceweasel & In the event processing script.

Fn + F5/F6 is used to adjust the screen brightness. It needs to echo some values to/proc/or/sys, which cannot be simply written in the script, generally, use a sequence;

Fn + f7: power off the screen, which is directly provided by acpi.

Fn + f8, switch the extended display, this has no hardware testing.

Fn + f9: To Start and Stop touchpad, you must first write a support file in xorg and then use synclient In the event processing script. This tool is also available to all users.

Fn + F10: start and stop the sound. Fn + F11/F12 is used to adjust the volume. In the acpid event processing script, it is set by calling amixer, this command can be called by any user. However, the ausu_apcid processing script uses Front to change the volume by default, and my audio card driver needs to be set through PCM, you need to modify it;

Therefore, the relationship is hardware vendor --> linux kernel --> acpi driver --> acpi daemon --> event handler.

On the root node, the successful use of software requires support from hardware and firmware.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.