├── AutoScroll.lua ├── Clip2OneNote ├── Clip2OneNote.lua ├── Clip2OneNotePath.lua └── README.md ├── JSTools.lua ├── OpenLink_NewTab.lua ├── OpenLink_SearchText.lua ├── OpenWithOtherBrowser.lua ├── OpeninGoogleWebeCache.lua ├── README.md ├── RenameBackup.bat ├── ScrollwithMouse.lua ├── Searchinwebsite.lua ├── Shutdown.lua ├── StrokesPlus.lua ├── StrokesPlus.png ├── StrokesPlus.xml ├── SupperBack.lua └── SupperForward.lua /AutoScroll.lua: -------------------------------------------------------------------------------- 1 | --Auto Scroll 2 | --by defpt 3 | --鼠标移动到桌面左侧(大概一个Win8任务栏宽度) 4 | function Timing()--计时器 5 | for i=0,60,1 do --请自行计算选择i的最大值(0和1中间那个值) 6 | if acGetMouseLocationX()<=60 then break --为了快速跳出循环采用了分步计时 7 | else acDelay(500) end --计时精度500ms 8 | end 9 | end 10 | while acGetMouseLocationX()>60 do 11 | Timing() 12 | if acGetMouseLocationX()<=60 then break 13 | else acSendKeys("{PGDN}") end 14 | end 15 | --滚屏速度=计时精度*i的最大值 16 | --默认设置计时精度理论值500ms,实际耗时应该会>500ms,PC的cpu不同,这个实际值也不同,不过应该差不太多 17 | --所以如果设置30秒一屏的话,i最大值=(30*1000ms)/500ms=60 18 | -------------------------------------------------------------------------------- /Clip2OneNote/Clip2OneNote.lua: -------------------------------------------------------------------------------- 1 | --Clip to OneNote 2 | --无需设置 OneNote 路径版 by defpt 3 | acSetClipboardText("") 4 | acSendKeys("^c") 5 | acDelay(50) 6 | local data=acGetClipboardText() 7 | if data ~= "" then 8 | acSendKeys("{DELAY=100}@r") 9 | acSendKeys("{DELAY=50}onenote /sidenote~") 10 | acDelay(3000) --看自己机子设置延时大小 11 | acSendKeys("^v") 12 | else 13 | acSendKeys("^a") 14 | acDelay(50) 15 | acSendKeys("^c") 16 | acDelay(50) 17 | acSendKeys("{DELAY=100}@r") 18 | acSendKeys("{DELAY=50}onenote /sidenote~") 19 | acDelay(3000) --看自己机子设置延时大小 20 | acSendKeys("^v") 21 | end 22 | -------------------------------------------------------------------------------- /Clip2OneNote/Clip2OneNotePath.lua: -------------------------------------------------------------------------------- 1 | --Clip to OneNote 2 | --设置 OneNote 路径版 by defpt 3 | acSetClipboardText("") 4 | acSendKeys("^c") 5 | local data=acGetClipboardText() 6 | if data ~= "" then 7 | acShellExecute("open","Onenote.exe","/sidenote","C:\\Program Files\\Microsoft Office\\Office15\\","") 8 | acDelay(3000) --看自己机子设置延时大小 9 | acSendKeys("^v") 10 | else 11 | acSendKeys("^a") 12 | acDelay(50) 13 | acSendKeys("^c") 14 | acDelay(50) 15 | acShellExecute("open","Onenote.exe","/sidenote","C:\\Program Files\\Microsoft Office\\Office15\\","") 16 | acDelay(3000) --看自己机子设置延时大小 17 | acSendKeys("^v") 18 | end 19 | -------------------------------------------------------------------------------- /Clip2OneNote/README.md: -------------------------------------------------------------------------------- 1 | 说明文档 2 | 3 | + [Clip2OneNote](https://github.com/defpt/StrokesPlus/blob/master/Clip2OneNote/Clip2OneNote.lua) 不需要设置路径,使用 win+R命令启动程序 4 | + [Clip2OneNotePath](https://github.com/defpt/StrokesPlus/blob/master/Clip2OneNote/Clip2OneNotePath.lua) 要在代码中设置绝对路径,注意双斜杠的问题 5 | -------------------------------------------------------------------------------- /JSTools.lua: -------------------------------------------------------------------------------- 1 | acSendKeys("^l") 2 | acSetClipboardText("这里填小书签代码") 3 | acSendKeys("^v") 4 | acSendKeys("{ENTER}") -------------------------------------------------------------------------------- /OpenLink_NewTab.lua: -------------------------------------------------------------------------------- 1 | --Open a link or New Tab(background) 2 | acConsumePhysicalInput(1) 3 | acMouseMove(gsx,gsy) 4 | acDelay(20) 5 | if acGetMouseCursorType() == "HAND" then 6 | acMouseClick(gsx, gsy, 1, 1, 1) 7 | else 8 | acSendKeys("^t") 9 | end 10 | acConsumePhysicalInput(0) 11 | -------------------------------------------------------------------------------- /OpenLink_SearchText.lua: -------------------------------------------------------------------------------- 1 | --Open a link or Search text(forground) 2 | acConsumePhysicalInput(1) 3 | acMouseMove(gsx,gsy) 4 | acDelay(20) 5 | if acGetMouseCursorType() == "HAND" then 6 | acSendControlDown() 7 | acDelay(25) 8 | acSendShiftDown() 9 | acMouseClick(gsx, gsy, 2, 1, 1) 10 | acDelay(25) 11 | acSendShiftUp() 12 | acSendControlUp() 13 | else 14 | acSetClipboardText("") 15 | acSendKeys("^c") 16 | acDelay(25) 17 | acSendKeys("^k") 18 | acDelay(25) 19 | acSendKeys("^v") 20 | acSendKeys("{DELAY=25}%{ENTER}") 21 | end 22 | acConsumePhysicalInput(0) 23 | -------------------------------------------------------------------------------- /OpenWithOtherBrowser.lua: -------------------------------------------------------------------------------- 1 | --Open With Other Browser 2 | --by defpt 3 | acSendKeys("%d") 4 | acDelay(25) 5 | acSendKeys("^c") 6 | acDelay(50) 7 | url=acGetClipboardText() 8 | acDelay(50) 9 | acShellExecute("open","iexplore.exe",url,"C:\\Program Files\\Internet Explorer\\","") 10 | -------------------------------------------------------------------------------- /OpeninGoogleWebeCache.lua: -------------------------------------------------------------------------------- 1 | --Open in GoogleWebeCache 2 | --by defpt 3 | acSetClipboardText("") 4 | acSendKeys("^l") 5 | acSendKeys("^c") 6 | acDelay(25) 7 | local url="http://webcache.googleusercontent.com/search?q=cache:"..acGetClipboardText() 8 | acShellExecute("",url,"","","") 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #StrokesPlus 说明文档 2 | 3 | StrokesPlus 是我用过的最好的完美支持win8 的全局手势了。下面给出一些相关链接 [StrokesPlus官网]( 4 | http://www.strokesplus.com/)、[官方下载地址](http://www.strokesplus.com/forum/forum.asp?FORUM_ID=6)、[StrokesPlus详细定制教程卡饭贴](http://bbs.kafan.cn/thread-1410275-1-1.html)、[我的配置文件说明卡饭贴](http://bbs.kafan.cn/thread-1427048-1-1.html) 5 | **下面是我的自用设置以及一些具体代码** 6 | 7 | ###我的配置文件 8 | + [StrokesPlus.lua](https://github.com/defpt/StrokesPlus/blob/master/StrokesPlus.lua) 是全局执行的脚本文件 9 | + [StrokesPlus.xml](https://github.com/defpt/StrokesPlus/blob/master/StrokesPlus.xml) 是所有自定义手势设置 10 | + [RenameBackup.bat](https://github.com/defpt/StrokesPlus/blob/master/RenameBackup.bat) 是备份文件重命名为原文件的批处理 11 | 12 | ###主要自写代码有如下几个: 13 | 14 | + [AutoScroll](https://github.com/defpt/StrokesPlus/blob/master/AutoScroll.lua) 自动滚屏,每次滚动一个屏幕。**要手势激活**,默认鼠标移动到桌面左侧(大概一个Win8任务栏宽度)可退出激活状态,可自己按需修改 15 | + [Clip2OneNote](https://github.com/defpt/StrokesPlus/blob/master/Clip2OneNote) 发送到 OneNote 包括两个版本,一个要设置路径,一个不需设置路径 16 | + [OpenInGoogleWebeCache](https://github.com/defpt/StrokesPlus/blob/master/OpenInGoogleWebeCache.lua) 用谷歌快照功能打开网页 17 | + [OpenLink_NewTab](https://github.com/defpt/StrokesPlus/blob/master/OpenLink_NewTab.lua) 新建标签或者新标签后台打开链接 18 | + [OpenLink_SearchText](https://github.com/defpt/StrokesPlus/blob/master/OpenLink_SearchText.lua) 搜索选中内容或者新标签前台打开链接 19 | + [OpenWithOtherBrowser](https://github.com/defpt/StrokesPlus/blob/master/OpenWithOtherBrowser.lua) 使用别的浏览器打开当前网页,这里用IE举例,其它任意浏览器皆可 20 | + [ScrollWithMouse](https://github.com/defpt/StrokesPlus/blob/master/ScrollwithMouse.lua) 划手势激活,光标移到滚动条滑块即可拖动鼠标进行自由滚动,鼠标移到桌面底部退出激活状态,可自己按需修改。**特别注意由于采用了滚动块颜色判定,***所以如过使用自定义滚动条要自己修改颜色代码* 21 | + [SearchInWebsite](https://github.com/defpt/StrokesPlus/blob/master/Searchinwebsite.lua) 站内搜索,不知道什么原因,只能用于Firefox,默认用的是谷歌引擎 22 | + [Shutdown](https://github.com/defpt/StrokesPlus/blob/master/Shutdown.lua) 关机 23 | + [SupperForward](https://github.com/defpt/StrokesPlus/blob/master/SupperForward.lua)、[SupperBack](https://github.com/defpt/StrokesPlus/blob/master/SupperBack.lua) 前进、后退,外加了模拟键盘左右方向键 24 | + [JSTools](https://github.com/defpt/StrokesPlus/blob/master/JSTools.lua) Firefox上调用小书签代码的模板,不过要配合启用地址栏可运行代码才行,可通过扩展(比如tab_utilities) 或脚本(uc脚本)总在当前标签页打开Bookmarklet,代码为: 25 | 26 | eval("openLinkIn = " + openLinkIn.toString().replace(/(?=if \(where == "save"\))/, 'if (url.substr(0, 11) == "javascript:") where = "current";').replace(/(?=var loadInBackground)/, 'if (w.gBrowser.currentURI.spec == "about:blank" && !w.gBrowser.mCurrentTab.hasAttribute("busy")) where = "current";')); 27 | 28 | ###所有功能效果图 29 | ![](https://github.com/defpt/StrokesPlus/blob/master/StrokesPlus.png?raw=true) -------------------------------------------------------------------------------- /RenameBackup.bat: -------------------------------------------------------------------------------- 1 | ren StrokesPlus.lua* StrokesPlus.lua 2 | ren StrokesPlus.xml* StrokesPlus.xml -------------------------------------------------------------------------------- /ScrollwithMouse.lua: -------------------------------------------------------------------------------- 1 | --Scroll with Mouse 2 | --by defpt 3 | --划手势激活,光标移到滚动条滑块即可拖动鼠标进行自由滚动,鼠标移到桌面底部退出激活状态 4 | function acScroll()--滚动状态 5 | if acGetExecutableName(nil, gsx, gsy) == "iexplore.exe" then --IE总是独立特行 6 | while acGetPixelRByPoint(x,y)..acGetPixelBByPoint(x,y)..acGetPixelGByPoint(x,y) ~= "205205205" do 7 | x=acGetMouseLocationX() 8 | y=acGetMouseLocationY() 9 | end 10 | else while acGetPixelRByPoint(x,y)..acGetPixelBByPoint(x,y)..acGetPixelGByPoint(x,y) ~= "166166166" do 11 | x=acGetMouseLocationX() 12 | y=acGetMouseLocationY() 13 | end 14 | end 15 | acMouseClick(acGetMouseLocationX(),acGetMouseLocationY(),2,1,0) 16 | while acGetMouseLocationY()<796 do d=acGetWindowRight(nil,gsx,gsy) - acGetMouseLocationX() 17 | if d > 32 then break 18 | else acDelay(500) end 19 | end 20 | acMouseClick(acGetMouseLocationX(),acGetMouseLocationY(),2,0,1) 21 | waiting() 22 | end 23 | 24 | function waiting()--非滚动等待状态 25 | while acGetMouseLocationY()<796 do d=acGetWindowRight(nil,gsx,gsy) - acGetMouseLocationX() 26 | if d<=32 then break 27 | else acDelay(500) end 28 | end 29 | main() 30 | end 31 | 32 | function main() 33 | if acGetMouseLocationY()<796 then acScroll() end 34 | end 35 | main() 36 | 37 | --d=距离,鼠标距离右边框两个滚动条宽度(32px) 38 | --796是我显示器(1280x800)底部,请自行设置该值 39 | --500此值设置检测当前鼠标位置的频率 40 | -------------------------------------------------------------------------------- /Searchinwebsite.lua: -------------------------------------------------------------------------------- 1 | --Search in website for firefox 2 | --by defpt 3 | acSetClipboardText("") 4 | acSendKeys("^c") 5 | acDelay(50) 6 | local text=acGetClipboardText() 7 | if text=="" then 8 | text=acInputBox("Google 站内搜索", "请输入待搜索内容", "") 9 | end 10 | if text~="" then 11 | acSendKeys("%d") 12 | acSendKeys("^c") 13 | acDelay(50) 14 | local domain=string.gsub(acGetClipboardText(),"https?://(.-)%/.*","%1") 15 | acDelay(50) 16 | local url="https://www.google.de/search?q=site:"..domain.." "..text 17 | acDelay(50) 18 | acShellExecute("",url,"","","") 19 | end -------------------------------------------------------------------------------- /Shutdown.lua: -------------------------------------------------------------------------------- 1 | --Shutdown 2 | --建议设置额外辅助键激活以免误关机,比如,左右键同时按下在划手势才激活, 3 | --传统关机 4 | --acRunProgram("c:\\windows\\system32\\shutdown.exe","-s -t 0",0,1) 5 | --win8混合关机 6 | acRunProgram("c:\\windows\\system32\\shutdown.exe","-s -hybrid -t 0",0,0) 7 | -------------------------------------------------------------------------------- /StrokesPlus.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defpt/StrokesPlus/4192dc2229c53859555d442c57578347e2ced342/StrokesPlus.lua -------------------------------------------------------------------------------- /StrokesPlus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defpt/StrokesPlus/4192dc2229c53859555d442c57578347e2ced342/StrokesPlus.png -------------------------------------------------------------------------------- /StrokesPlus.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defpt/StrokesPlus/4192dc2229c53859555d442c57578347e2ced342/StrokesPlus.xml -------------------------------------------------------------------------------- /SupperBack.lua: -------------------------------------------------------------------------------- 1 | --SupperBack 2 | local x = acGetWindowTitle(nil, gsx, gsy) 3 | acDelay(50) 4 | acSendKeys("{BROWSERBACK}") 5 | acDelay(50) 6 | local y=acGetWindowTitle(nil, gsx, gsy) 7 | if x==y then 8 | acSendKeys("{LEFT}") 9 | end 10 | -------------------------------------------------------------------------------- /SupperForward.lua: -------------------------------------------------------------------------------- 1 | --SupperForward 2 | local x = acGetWindowTitle(nil, gsx, gsy) 3 | acDelay(50) 4 | acSendKeys("{BROWSERFORWARD}") 5 | acDelay(50) 6 | local y=acGetWindowTitle(nil, gsx, gsy) 7 | if x==y then 8 | acSendKeys("{RIGHT}") 9 | end 10 | --------------------------------------------------------------------------------