Ubuntu 改滑鼠側鍵為ctrl,並配合滾輪實現頁面縮放
本人親自在Ubuntu 18.04上成功將滑鼠側鍵映射為ctrl,可保持長按。可以按住滑鼠側鍵並滾動滑鼠滾輪實現頁面縮放,下面是方法。
參考: Map Ctrl and Alt to mouse thumb buttons
首先安裝Easystroke (sudo apt install easystroke)。這是個圖形化軟體,操作簡單。打開軟體界面後按以下步驟設置:
- 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")
- Preferences tab: Select "Autostart Easystroke"
- Actions tab: Add Action
- Name: anything you like (e.g. "Mouse 20 -> Ctrl")
- Type: "Ignore"
- 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"
- 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)
- 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]
※轉 fastjson 過濾不需要的欄位或者只要某些欄位
※JohnsonChung
TAG:程序員小新人學習 |