Surface Pen (SP4版)的顶按钮(top button)可用AutoHotKey(AHK)重新定义功能。
网络上有人找到对应的AHK key symbol,所以可以轻松重定。
(我之前在板上有介绍AHK这套软件: #1MUFlaRM)
我以桌面版PowerPoint为例,写了一个script,它可以按一下顶按钮,
让笔在PowerPoint的Presentation mode中切换划笔与雷射笔。连按两下,换下一张
slide。长按一下,换上一张slide。PowerPoint以外的程式则维持原功能。script如下:
; Redefine Surface Pen (SP4) top button for PowerPoint Presentation mode.
; Initialized global variables.
class gv {
static penMode := 0
}
; Single click for switching between pens.
#F20::
; Programs except PowerPoint.
If !WinActive("ahk_exe POWERPNT.exe") {
Send, #{F20}
Return
}
; Switch to Laser Pen.
If (gv.penMode == 0) {
Send, ^l
gv.penMode := 1
}
; Switch to Pen.
Else {
; Sleep for a while before sending ^p.
; Otherwise, sometime PowerPoint goes back one page.
; I don't know why.
Sleep, 50
Send, ^p
gv.penMode := 0
}
Return
; Double clicks for next slide.
#F19::
; Programs except PowerPoint.
If !WinActive("ahk_exe POWERPNT.exe") {
Send, #{F19}
Return
}
Send, {Right}
Return
; Long press for previous slide.
#F18::
; Programs except PowerPoint.
If !WinActive("ahk_exe POWERPNT.exe") {
Send, #{F18}
Return
}
Send, {Left}
Return
比较妙之处是我发现在切换笔时,如果太快切,^p有时会变成回上一页投影片,
后来加个Sleep就解决了:)
此script适用S3 + SP4 Pen。