简体   繁体   中英

Linux kernel : Remove input handler from a driver

when I see the output of cat /proc/bus/input/devices I see this:

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

In order to remove handler it is just enough to comment the related _set_bit in the driver source code. 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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