[平板] Surface Pen (SP4版)頂按鈕自定 by AHK
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。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.45.106.137
※ 文章網址: https://www.ptt.cc/bbs/WindowsPhone/M.1454151742.A.680.html
推
01/30 19:52, , 1F
01/30 19:52, 1F
※ 編輯: zxvc (114.45.106.137), 01/30/2016 21:21:59
→
01/30 21:22, , 2F
01/30 21:22, 2F
→
01/30 21:23, , 3F
01/30 21:23, 3F
→
01/30 21:23, , 4F
01/30 21:23, 4F
推
01/31 14:37, , 5F
01/31 14:37, 5F
※ 編輯: zxvc (114.43.61.181), 02/01/2016 23:42:39
WindowsPhone 近期熱門文章
PTT數位生活區 即時熱門文章