我需要編輯和重新編譯哪些原始程式碼才能使遊標變慢?

我需要編輯和重新編譯哪些原始程式碼才能使遊標變慢?

我有 Linux Mint 19.3 (MATE x64),並且我有一個 Logitech G402 滑鼠,我想與它一起使用。

使用預設設置,我的遊標移動準確50比我希望它移動的速度快幾倍。

我嘗試了各種設定來讓遊標變慢,但它們就是不起作用。

指標速度設定(「開始」功能表 -> 首選項 -> 滑鼠)幾乎沒有什麼區別,即使我將它們設定為絕對最小值。

xinput這是預設設定的輸出:

$ xinput list-props "Logitech Gaming Mouse G402"
Device 'Logitech Gaming Mouse G402':
    Device Enabled (155):   1
    Coordinate Transformation Matrix (157): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (292):   0
    libinput Natural Scrolling Enabled Default (293):   0
    libinput Scroll Methods Available (294):    0, 0, 1
    libinput Scroll Method Enabled (295):   0, 0, 0
    libinput Scroll Method Enabled Default (296):   0, 0, 0
    libinput Button Scrolling Button (297): 2
    libinput Button Scrolling Button Default (298): 2
    libinput Middle Emulation Enabled (299):    1
    libinput Middle Emulation Enabled Default (300):    0
    libinput Accel Speed (301): 0.000000
    libinput Accel Speed Default (302): 0.000000
    libinput Accel Profiles Available (303):    1, 1
    libinput Accel Profile Enabled (304):   1, 0
    libinput Accel Profile Enabled Default (305):   1, 0
    libinput Left Handed Enabled (306): 0
    libinput Left Handed Enabled Default (307): 0
    libinput Send Events Modes Available (277): 1, 0
    libinput Send Events Mode Enabled (278):    0, 0
    libinput Send Events Mode Enabled Default (279):    0, 0
    Device Node (280):  "/dev/input/event5"
    Device Product ID (281):    1133, 49278
    libinput Drag Lock Buttons (308):   <no items>
    libinput Horizontal Scroll Enabled (309):   1

這裡唯一可以影響我的遊標速度的選項是座標變換矩陣(也是加速速度,但不會超過 -1,我需要它遠遠超過 -1)。如果我將其設置為1 0 0 0 1 0 0 0 50,我的遊標速度將正確除以 50。然而非標準的座標變換矩陣將導致捕獲遊標的遊戲(例如《我的世界》)無法正常工作,每次釋放遊標時都會將遊標重置到幾乎螢幕的左上角,並使我的角色在旋轉時向左上方瘋狂旋轉被捕獲。

在我看來,我已經沒有辦法讓我的滑鼠使用預期的方法正常工作,所以我覺得我必須編輯一些原始程式碼以使我的遊標以合理的速度移動,聽起來很瘋狂。我非常絕望,以至於我準備將硬編碼/ 50.0放入一些 C 程式碼中,編譯,安裝,然後就到此為止,但不幸的是我不知道在哪裡將其放入。

當然,我們都可能知道這是我在這裡問的一個怪物般的 XY 問題,所以如果有更多選項來配置我的遊標(我幾天都沒有找到或谷歌),那麼我會很高興了解他們。

答案1

libinput我在 , 中找到了相關代碼filter-low-dpi.c。我將函數的返回值calculate_acceleration_factor除以50.0,然後按照說明進行編譯和安裝。

如果您遇到類似問題,根據您的滑鼠型號,您可能需要進行編輯filter-mouse.c

相關內容