简体   繁体   English

Linux 内核:从驱动程序中删除输入处理程序

[英]Linux kernel : Remove input handler from a driver

when I see the output of cat /proc/bus/input/devices I see this:当我看到cat /proc/bus/input/devices的输出时,我看到了:

I: Bus=0010 Vendor=0001 Product=0001 Version=0100
N: Name="aml_keypad"
P: Phys=keypad/input0
S: Sysfs=/devices/c8100580.rc/input/input0
U: Uniq=
H: Handlers=kbd mouse0 event0 
B: PROP=0
B: EV=7
B: KEY=7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff fffffffffffffffe
B: REL=103

How can I remove a handler from the driver.如何从驱动程序中删除处理程序。 (I am compiling the kernel for myself) (我正在为自己编译内核)

For example I want to remove mouse0 from handlers例如,我想从处理程序中删除 mouse0

In order to remove handler it is just enough to comment the related _set_bit in the driver source code.为了删除处理程序,只需在驱动程序源代码中注释相关的_set_bit In my case :就我而言:

// __set_bit(BTN_MOUSE, dev->input_device->keybit);
// __set_bit(BTN_LEFT, dev->input_device->keybit);
// __set_bit(BTN_RIGHT, dev->input_device->keybit);
// __set_bit(BTN_MIDDLE, dev->input_device->keybit);
//
// __set_bit(EV_REL, dev->input_device->evbit);
// __set_bit(REL_X, dev->input_device->relbit);
// __set_bit(REL_Y, dev->input_device->relbit);
// __set_bit(REL_WHEEL, dev->input_device->relbit);

The above snippet is part of this file .上面的代码片段是这个文件的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM