如何映射鼠标中键以进行双击?

chi*_*ila 3 unity 18.04

乌班图18.04。当我单击鼠标中键时,它应该双击。谢谢。

编辑:使用 Unity 桌面。

UnK*_*OWn 5

操作系统:Ubuntu 18:04
所需软件包:xdotoolxbindkeys

你可以安装这些软件包sudo apt install xdotool xbindkeys

gedit .xbindkeysrc
Run Code Online (Sandbox Code Playgroud)

粘贴以下内容

"xdotool click --repeat 2 1"
b:2
Run Code Online (Sandbox Code Playgroud)

保存文件并运行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'
Run Code Online (Sandbox Code Playgroud)

在 Ubuntu 18.04.3 上测试


解决方法

如果你已经像这样安装了unitysudo apt install unity

.xbindkeysrc然后使用文件中的以下内容

"xdotool click --repeat 2 1"
b:2 + Release
Run Code Online (Sandbox Code Playgroud)

在 Ubuntu 18.04 上使用 Unity 会话进行了测试。