Ubuntu 改鼠标侧键为ctrl,并配合滚轮实现页面缩放

原创
2018/10/10 19:54
阅读数 953

无偿推广: Mac OS 最强鼠标改键软件:BetterAndBetter

本人亲自在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
     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'
  4. 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)
  5. 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

以上就是全部教程。


长按右键设置
比如我想将长按鼠标右键映射为F5。打开easystroke软件界面后按以下步骤设置:

  1. 偏好设置选项卡:额外按键 -> 添加 -> 单选按钮 "超时" -> 将鼠标移动到灰色区域并按下右键(我的鼠标右键被识别为按键3)
  2. 偏好设置选项卡:行为 -> 超时档案 -> 保持
  3. 动作选项卡:添加动作
     名字:随便取(比如“长按右键刷新”)
     类别:按键
     详细信息:点击,然后按下“F5”
     手势:双击,然后按下鼠标右键,出现警告选择“是”,这时候手势区域会显示 '3 -> X'
  4. 在网页中长按鼠标右键就可以实现刷新了

你还可以将 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]
我的原创文章: [Mac OS 最强鼠标改键软件:BetterAndBetter]

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部