gnome 加快鼠標滾動速度的方法,全局有效 & YOGA 3 默認 Esc 鍵方法
发表于 : 2012-06-15 14:29
之前用觸摸板,手指不怎麼累,現在公司的鼠標滾到手痛,左手痛了換右手,右手痛了再換回左手,今天終於頂唔順,搜了一下解決方法,下面這位總結的方法比較全:http://forum.ubuntu.org.cn/viewtopic.php?f=42&t=322880
但我沒有成功,ff 方法非全局不考慮,xorg.conf 改了也沒作用,沒看懂 xorg.conf 修改是什麼意思。
後來,我就諗到修改鼠標驅動,滾一下重複上報多次,修改內核代碼 driver/hid/hid-input.c 文件,找到函數 hidinput_hid_event 最後,修改原始:
添加後:
通過 ((usage->type == EV_REL) && (usage->code == REL_WHEEL)) 來過濾鼠標滾動,發現當前事件爲鼠標滾動後,額外多報兩次事件。
也就是說,現在滾一下相當於修改前滾三下!

PS:修改的內核代碼版本爲 3.2.0-rc7, 此文件應該很少更新,版本不是很重要,僅供參考。
但我沒有成功,ff 方法非全局不考慮,xorg.conf 改了也沒作用,沒看懂 xorg.conf 修改是什麼意思。
後來,我就諗到修改鼠標驅動,滾一下重複上報多次,修改內核代碼 driver/hid/hid-input.c 文件,找到函數 hidinput_hid_event 最後,修改原始:
代码: 全选
……
/* report the usage code as scancode if the key status has changed */
if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value)
input_event(input, EV_MSC, MSC_SCAN, usage->hid);
input_event(input, usage->type, usage->code, value);
if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type == EV_KEY))
input_event(input, usage->type, usage->code, 0);
}
代码: 全选
……
/* report the usage code as scancode if the key status has changed */
if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value)
input_event(input, EV_MSC, MSC_SCAN, usage->hid);
input_event(input, usage->type, usage->code, value);
/* faster the wheel */
if ((usage->type == EV_REL) && (usage->code == REL_WHEEL)) {
input_event(input, usage->type, usage->code, value);
input_event(input, usage->type, usage->code, value);
}
if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type == EV_KEY))
input_event(input, usage->type, usage->code, 0);
}
也就是說,現在滾一下相當於修改前滾三下!

PS:修改的內核代碼版本爲 3.2.0-rc7, 此文件應該很少更新,版本不是很重要,僅供參考。