當前位置:
首頁 > 知識 > Ubuntu 改滑鼠側鍵為ctrl,並配合滾輪實現頁面縮放

Ubuntu 改滑鼠側鍵為ctrl,並配合滾輪實現頁面縮放

本人親自在Ubuntu 18.04上成功將滑鼠側鍵映射為ctrl,可保持長按。可以按住滑鼠側鍵並滾動滑鼠滾輪實現頁面縮放,下面是方法。

參考: Map Ctrl and Alt to mouse thumb buttons

首先安裝Easystroke (sudo apt install easystroke)。這是個圖形化軟體,操作簡單。打開軟體界面後按以下步驟設置:

  1. Preferences tab: additional buttons -> add -> radio button "Instant Gestures" -> click the mouse button of choice in the grey area (for me a "back, thumb button" became "(Instantly) Button 20")
  2. Preferences tab: Select "Autostart Easystroke"
  3. Actions tab: Add Action
  4. Name: anything you like (e.g. "Mouse 20 -> Ctrl")
  5. Type: "Ignore"
  6. Details: click it once to change "Ignore" to "Key combination...". then press Ctrl + a. "a" doesn"t matter and is ignored. "Key Combination" will be replaced with "Ctr"
  7. With the new action selected/highlighted -> click "Record Stroke" -> press the mouse button you"re wanting to use again (this came up with "20 -> 20" in the Stroke column for me)
  8. Now pressing and holding my mouse button brings up a dinky "Ctr" on the screen and acts like the button is being held for as long as the mouse button is

以上就是全部教程。



你還可以將 Easystroke 與 xte 結合使用,實現更多快捷鍵。

參考: How can I assign actions to all my mouse buttons?

首先安裝 xte

sudo apt-get install xautomation

Now, if you run on a terminal something like:

xte "keydown Control_L" "key F10" "keyup Control_L"

that means simulate a Ctrl+F10 keypress.

在 easystroke 里設置詞典軟體 Goldendict (sudo apt-get install goldendict)的查詞快捷鍵(Ctrl+C+C):

xte "keydown Control_L" "keydown C" "keyup C" "keydown C" "keyup C" "keyup Control_L" "keydown Control_L" "keydown C" "keyup C" "keydown C" "keyup C" "keyup Control_L"


其它相關內容: [xdotool], [Windows滑鼠改鍵軟體:X-Mouse Button Control]

Ubuntu 改滑鼠側鍵為ctrl,並配合滾輪實現頁面縮放

喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 程序員小新人學習 的精彩文章:

轉 fastjson 過濾不需要的欄位或者只要某些欄位
JohnsonChung

TAG:程序員小新人學習 |