在 Linux 中使用軌跡點時如何停用觸控板?

在 Linux 中使用軌跡點時如何停用觸控板?

我最近在我的筆記型電腦上安裝了 Ubuntu(及其衍生品 Xubuntu 和 Kubuntu)。

我的電腦上有觸控板和指點桿。在 Windows 中,當我使用指點桿時,觸控板會停用。

有什麼辦法可以在 Linux 中重新建立這個嗎?

答案1

我在谷歌上搜尋了一遍,尋找解決這個問題的方法,這是我想出的適合我的系統的方法:

#!/bin/bash
#
#Change /dev/input/event13 to your trackstick event
    cat /dev/input/event13 > /tmp/mousemove &
#initialize counter to prevent garbage file from growing
    i="0";
    while true ; do 
        i=$[$i+1];
        #variables  
        oldchecksum=${newchecksum};
        newchecksum=`md5sum /tmp/mousemove | awk '{print $1}'`
        #see if trackpad is already disabled
        if [ "$trackpad" = "off" ]; then

            #compare previous checksum to current if they're same trackstick is not moving
            if [ "$oldchecksum" = "$newchecksum" ]; then
                #make sure trackpad is enabled
                xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1;
                trackpad="on";
            fi

        else

            #compare previous checksum to current if they're different trackstick is moving
            if [ "$oldchecksum" != "$newchecksum" ]; then
                #disable trackpad
                xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0;
                trackpad="off";
            fi

        fi

        #check for count to keep poll file smaller
        if [ "$i" = "300" ]; then
            echo '' > /tmp/mousemove;
            i="0";
            newchecksum=`md5sum /tmp/mousemove | awk '{print $1}'`
        fi
            #sleep for 1 second so we don't eat up resources
            #if the update speed is not fast enough for you a smaller number such as .75 may be better
            sleep 1;
    done

由於我在 arch 上運行 Fluxbox,所以我在我的中添加了腳本調用~/.fluxbox/apps

我發現的唯一警告是,如果您設法以 root 身份 pkill cat (必須運行該腳本才能訪問滑鼠事件),您將殺死該腳本,同時如果您殺死該腳本而不殺死該腳本cat 它將繼續運行,直到您用完中的空間/tmp、 pkill cat 或重新啟動系統。

答案2

我有一個簡單的技巧(確實是黑客):

xinput set-prop "DLL07B0:01 044E:120B" "Synaptics Finger" 100 1000 100

它的作用是設定錯誤的壓力參數(最小>最大),以及一些荒謬的手指尺寸。

Synaptics Finger
    32 bit, 3 values, low, high, press. 

Option "FingerLow" "integer"
    When finger pressure drops below this value, the driver counts it as a release. Property: "Synaptics Finger"

Option "FingerHigh" "integer"
    When finger pressure goes above this value, the driver counts it as a touch. Property: "Synaptics Finger" 

因此,當壓力 > 1000 且壓力 < 100 時,駕駛甚至會計為按下,這在邏輯上是不可能的。

相關內容