Thinkpad键盘是非常好用的一款键盘,体验和传统的Thinkpad笔记本键盘一样,而且还支持小红帽(Trackpoint,指点杆)。
小红帽在使用上双手不需要离开键盘,甚至不用移动手掌位置就可以控制鼠标,比起触摸板和普通鼠标来说,使用效率提高得非常多,而且不容易累和不容易鼠标手。小红帽中键上下滚屏功能更是方便至极。
这里我的将小红帽鼠标中键滚动的脚本做成了exe供下载:32位,64位
以下是让Thinkpad USB键盘支持小红帽中键滚轮的Autohotkey脚本:
;; ;; Trackpoint.ahk ;; Author: Chiyuan Zhang <[email protected]> ;; 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