如何映射滑鼠中鍵以進行雙擊?

如何映射滑鼠中鍵以進行雙擊?

烏班圖18.04。當我單擊滑鼠中鍵時,它應該雙擊。謝謝。

編輯:使用 Unity 桌面。

答案1

作業系統:Ubuntu 18:04
所需軟體包:xdotoolxbindkeys

你可以安裝這些軟體包sudo apt install xdotool xbindkeys

gedit .xbindkeysrc

貼上以下內容

"xdotool click --repeat 2 1"
b:2

儲存檔案並運行xbindkeys --poll-rc

現在您的中鍵單擊應該像雙擊一樣工作。

man xdotool一些內容來看

   click [options] button
       Send a click, that is, a mousedown followed by mouseup for the
       given button with a short delay between the two (currently 12ms).

       Buttons generally map this way: Left mouse is 1, middle is 2, right
       is 3, wheel up is 4, wheel down is 5.

       --clearmodifiers
           Clear modifiers before clicking. See CLEARMODIFIERS below.

       --repeat REPEAT
           Specify how many times to click. Default is 1. For a double-
           click, use '--repeat 2'

在 Ubuntu 18.04.3 上測試


解決方法

如果你已經這樣安裝了unitysudo apt install unity

然後使用.xbindkeysrc文件中的以下內容

"xdotool click --repeat 2 1"
b:2 + Release

在 Ubuntu 18.04 上使用 Unity 會話進行了測試。

答案2

我運氣不佳btnx,所以xdotool,如果您使用Linux Mint或其他Ubuntu基於發行版,我建議輸入重映射器可以在倉庫上找到:

sudo apt install input-remapper

然後,使用以下程式碼配置所需的按鈕:

repeat(2, key(BTN_LEFT).w(50))

這將重複滑鼠左鍵,延遲 50 毫秒。使用該標準key(BTN_LEFT).key(BTN_LEFT)對我來說不起作用,大概是因為沒有ButtonRelease及時發送事件以被肉桂檢測到。享受!

相關內容