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

无偿推广: 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]

转载于:https://my.oschina.net/luochuan01/blog/2240270

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值