让Thinkpad USB键盘支持小红帽中键滚轮的方法(ThinkPad USB Keyboard with TrackPoint)
2013-05-15 15:19
555 查看
Thinkpad键盘是非常好用的一款键盘,体验和传统的Thinkpad笔记本键盘一样,而且还支持小红帽(Trackpoint,指点杆)。
小红帽在使用上双手不需要离开键盘,甚至不用移动手掌位置就可以控制鼠标,比起触摸板和普通鼠标来说,使用效率提高得非常多,而且不容易累和不容易鼠标手。小红帽中键上下滚屏功能更是方便至极。
不过Thinkpad USB键盘上面的小红帽,有个很大的问题:部分程序不能支持中键上下滚屏,尤其是基于Java的桌面程序,像Netbeans,Evennote等等。
之前找了非常多的方法,替换了几次官网上的驱动程序,而且国外的许多网站有很多人提出此问题,不过看情况官方是没兴趣解决这个问题。所以只能避免使用不支持的软件,也放弃了许多优秀的软件。
今天在研究idea软件的时候,意外找到了最好的解决方法,用AutoHotkey将小红帽的鼠标中键映射成滚屏。原文出自这里。
AutoHotkey的使用可以Google一下,是功能极其强大的自动化操作辅助软件。
Autohotkey可以支持直接将脚本转换成exe,让不安装Autohotkey的电脑也可以用其功能,
这里我的将小红帽鼠标中键滚动的脚本做成了exe供下载:32位,64位
下载后直接运行就可以成功让小红帽支持中键滚屏。
以下是让Thinkpad USB键盘支持小红帽中键滚轮的Autohotkey脚本:
小红帽在使用上双手不需要离开键盘,甚至不用移动手掌位置就可以控制鼠标,比起触摸板和普通鼠标来说,使用效率提高得非常多,而且不容易累和不容易鼠标手。小红帽中键上下滚屏功能更是方便至极。
不过Thinkpad USB键盘上面的小红帽,有个很大的问题:部分程序不能支持中键上下滚屏,尤其是基于Java的桌面程序,像Netbeans,Evennote等等。
之前找了非常多的方法,替换了几次官网上的驱动程序,而且国外的许多网站有很多人提出此问题,不过看情况官方是没兴趣解决这个问题。所以只能避免使用不支持的软件,也放弃了许多优秀的软件。
今天在研究idea软件的时候,意外找到了最好的解决方法,用AutoHotkey将小红帽的鼠标中键映射成滚屏。原文出自这里。
AutoHotkey的使用可以Google一下,是功能极其强大的自动化操作辅助软件。
Autohotkey可以支持直接将脚本转换成exe,让不安装Autohotkey的电脑也可以用其功能,
这里我的将小红帽鼠标中键滚动的脚本做成了exe供下载:32位,64位
下载后直接运行就可以成功让小红帽支持中键滚屏。
以下是让Thinkpad USB键盘支持小红帽中键滚轮的Autohotkey脚本:
;; ;; Trackpoint.ahk ;; Author: Chiyuan Zhang <pluskid@gmail.com> ;; Version: 1.0 (Sep. 03, 2009) ;; ;; Thinkpad trackpoint driver on Windows doesn't allow ;; to use both middle-click and scrolling simultaneously. ;; If you enable the scrolling, you'll not be able to ;; click the middle button (e.g. to open a link in the ;; background in Firefox). ;; ;; However, on Linux, one can get a good behavior where ;; both middle-click and scrolling behaves well (see ;; www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint). ;; ;; This script trys to make it behave similarly. When you ;; press the middle button and release in a short time, it ;; will be a regular middle-click. However, if you hold it ;; and move the cursor, it will do scrolling. ;; ;; Configuration ;#NoTrayIcon ; Milliseconds threshold, hold the middle button for some time ; exceeding this will start to detect scrolling. tp_StartScrollTThreshold = 70 ; Pixels threshold, for both X and Y. Only when the mouse movement ; exceed this threshold will we start scrolling. tp_StartScrollXThreshold = 7 tp_StartScrollYThreshold = 4 ; Milliseconds interval to check further scrolling. Set this to a ; smaller value will make scrolling more fast, and vice versa. tp_ScrollCheckInterval = 45 ;; This key/Button activates scrolling tp_TriggerKey = MButton ;; End of configuration #Persistent CoordMode, Mouse, Screen Hotkey, %tp_TriggerKey%, tp_TriggerKeyDown HotKey, %tp_TriggerKey% Up, tp_TriggerKeyUp return tp_TriggerKeyDown: tp_Scroll = n MouseGetPos, tp_OrigX, tp_OrigY SetTimer, tp_CheckForScrollEventAndExecute, %tp_StartScrollTThreshold% return tp_TriggerKeyUp: SetTimer, tp_CheckForScrollEventAndExecute, Off ;; Send a middle-click if we did not scroll if tp_Scroll = n MouseClick, Middle return tp_CheckForScrollEventAndExecute: tp_Scroll = y SetTimer, tp_CheckForScrollEventAndExecute, %tp_ScrollCheckInterval% MouseGetPos, tp_NewX, tp_NewY tp_DistanceX := tp_NewX - tp_OrigX tp_DistanceY := tp_NewY - tp_OrigY if tp_DistanceY > %tp_StartScrollYThreshold% MouseClick, WheelDown else if tp_DistanceY < -%tp_StartScrollYThreshold% MouseClick, WheelUp ; 0x114 is WM_HSCROLL if tp_DistanceX > %tp_StartScrollXThreshold% { ControlGetFocus, FocusedControl, A SendMessage, 0x114, 1, 0, %FocusedControl%, A } else if tp_DistanceX < -%tp_StartScrollXThreshold% { ControlGetFocus, FocusedControl, A SendMessage, 0x114, 0, 0, %FocusedControl%, A } return
相关文章推荐
- 给Jquery添加alert,prompt方法,类似系统的Alert,Prompt,可以响应键盘,支持拖动
- 【转】再谈DBGrid斑马纹效果 和 解决DBGrid支持滚轮效果最终方法
- VMware直接使用主机USB HID(包含USB键盘鼠标)的方法
- VB6.0对鼠标滚轮不支持的解决方法
- 支持 PS/2 与 USB 的键盘过滤驱动(可卸载)
- Thinkpad USB 经典键盘使用体验
- linux系统中Virtualbox启用USB设备支持的方法
- thinkpad E40 键盘错乱解决方法
- 以前读不懂,现在读了发现有太多的东西可以参考了:支持PS2与USB的键盘过滤驱动(可卸载)
- IQKeyboardManager导致键盘不能弹出,代理方法执行多遍
- linux系统中Virtualbox启用USB设备支持的方法
- (转)支持 PS/2 与 USB 的键盘过滤驱动(可卸载)
- 常用事件方法及技巧(三) -- KeyboardEvent(键盘事件)
- u-boot下USB键盘支持
- [Silverlight]让DataGrid支持滚轮的山寨方法
- 支持 PS/2 与 USB 的键盘过滤驱动(可卸载)
- 让S5pv210 android2.3 系统支持USB鼠标的方法(作者:gooogleman)
- 【转载】完美解决ThinkPad 在Win7系统下弹出USB等反应慢的方法
- 让Fedora 19支持ThinkPad鼠标中键和小红点实现滚轮效果
- Thinkpad 笔记本VMware Workstation 安装虚拟机出现“此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态”解决方法