ImageVerifierCode 换一换
格式:DOCX , 页数:23 ,大小:54.75KB ,
资源ID:9375875      下载积分:10 金币
验证码下载
登录下载
邮箱/手机:
图形码:
验证码: 获取验证码
温馨提示:
支付成功后,系统会自动生成账号(用户名为邮箱或者手机号,密码是验证码),方便下次登录下载和查询订单;
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/9375875.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请。


权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4009-655-100;投诉/维权电话:18658249818。

注意事项

本文(AutoHotKey使用教程.docx)为本站上传会员【仙人****88】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

AutoHotKey使用教程.docx

1、AutoHotKey使用教程 AutoHotKey使用教程(一)-----何为AutoHotKey? AutoHotKey是一个免费开源的小软件,很小(只有1964 KB),但是功能却非常强大,它几乎可以做键盘、鼠标和操纵杆可以做的任何事情。它可以把人力完全的释放出来,前提只要你编写一个后缀为.ahk的脚本。如果你愿意,你完全可以把你写的script理解为一个机器人,它可以做你想让它做的任何事情。 AutoHotKey在国外使用的很普遍,国内也有很大的用户群,大家只要Google一下就知道了,AutoHotKey之前的版本是AutoIt2,现在newest的版本是AutoIt3

2、但是AutoHotKey还是一个比较经典的版本,最新的版本是1.0.47.04,建议大家下载一下,有什么使用心得,多交流哈,呵呵。我会定期在我的博客上更新使用心得,大家多关注啊。 AutoHotKey使用教程(二)-----一个简单的例子 使用AutoHotKey编写脚本非常简单,现在我们就来开始编写我们的第一个简单的脚本吧。 使用notepad或者其他你熟悉的文本编辑器,新建一个文件,使用.ahk作为后缀名,例如test.ahk 。把下面的代码拷贝进去,保存退出,双击执行一下。     代码: MsgBox,你好,欢迎关注风追月博客 `n 请继续关注哈 run, 看到什

3、么结果了吗?神奇吗?简单吗?呵呵 如果感兴趣的话,我还会在后面的章节中,更加详细得讲解。 AutoHotKey使用教程(三)-----定义属于自己的热键 通过本节的学习,你可以自定义热键快速启动常用的程序、文档、目录、网址和WINDOWS的常用功能(如:增大\减小音量、系统静音开关、弹出\关闭光驱、打开控制面板模块属性等等)。在日常的工作中,它的确可以帮助您节省不少鼠标频繁点击的时间,从而大大的提高工作效率。 我们先来看一段简单的代码: #n:: Run Notepad return 在上面的代码中,"#"代表windows键(一种修饰符), "return"表示结束热键定

4、义。如果一个热键定义中只有一个语句,如上面的例子,那么这条语句就可以放在::的后面,不需要添加"return": #n:: Run Notepad     如果热键包含多个按键,组合键连续的放在一起(不需要考虑顺序),下面的例子即使用^!来代替Control+Alt : ^!s:: Send Sincerely,{enter}John Smith ; This line sends keystrokes to the active (foremost) window. return        你可以同时定义多个热键,它们触发相同的事件,只要把热键“垂直”定义即可。 ^Num

5、pad0:: ^Numpad1:: MsgBox Pressing either Control+Numpad0 or Control+Numpad1 will display this message. return     如果你要禁用某个热键,非常简单,只要在return之前不写任何语句即可,下面的例子就禁用的右边的Windows键 RWin::return AutoHotKey使用教程(四)----一些常用的修饰符 符号                        用法 # Windows键 ! Alt ^ Control + Shift &

6、 逻辑与,把多个按键或鼠标组合成一个自定义键,Windows 95/98/Me无法识别 < 一对按键中的左边的按键,如 一对按键中的右边的按键 * 通配符,表示热键被按下时,即使同时还有其他的按键按下,依然有效 *#c::Run Calc.exe ; Win+C, Shift+Win+C, Ctrl+Win+C, etc. will all trigger this hotkey. *ScrollLock::Run Notepad ; Pressing Scrolllock will trigger this hotkey even when

7、modifer key(s) are down. ~ 热键被触发后,动作不会被阻塞 AutoHotKey使用教程(五)----按键重映射 按键重映射的语法格式:OriginKey::DestinationKey。请看下面的例子: a::b        在上面的例子中体会以下几点: 1) 使用键盘敲“a“,会自动映射成”b“ 2) 敲”Shift + a “ 呢?           B 3) 敲”capslock + a “ 呢?    B 4) 敲”b“ 呢?         还是b          a::B 1)      使用键盘敲“a“,会自动映射

8、成”B“ 2)      敲”Shift + a “ 呢?            B 3)      敲”capslock + a “ 呢?    b 总结:”Shift + a “ 跟 “a“的效果是一样的,”capslock + a “是按映射后在转换大小写。           鼠标的重映射语法跟按键重映射一致。 RAlt::RButton ; Makes the right Alt key behave like the right mouse button. RWin::Return   ; Disables the right Windows key by havi

9、ng it simply return        使用#IfWinActive/Exist语句可以控制重映射生效的窗口。 #IfWinActive ahk_class Notepad a::b ; Makes the 'a' key send a 'b' key, but only in Notepad. #IfWinActive ; This puts subsequent remappings and hotkeys in effect for all windows. 一段使用键盘控制鼠标的代码,大家有兴趣可以试一试。 *#up::MouseMove, 0, -10, 0

10、 R ; Win+UpArrow hotkey => Move cursor upward *#Down::MouseMove, 0, 10, 0, R ; Win+DownArrow => Move cursor downward *#Left::MouseMove, -10, 0, 0, R ; Win+LeftArrow => Move cursor to the left *#Right::MouseMove, 10, 0, 0, R ; Win+RightArrow => Move cursor to the right *<#RCtrl:: ; LeftWin + Rig

11、htControl => Left-click (hold down Control/Shift to Control-Click or Shift-Click). SendEvent {Blind}{LButton down} KeyWait RCtrl ; Prevents keyboard auto-repeat from repeating the mouse click. SendEvent {Blind}{LButton up} return *<#AppsKey:: ; LeftWin + AppsKey => Right-click SendEvent {Blind

12、}{RButton down} KeyWait AppsKey ; Prevents keyboard auto-repeat from repeating the mouse click. SendEvent {Blind}{RButton up} return AutoHotKey使用教程(六)-----鼠标和键盘按键操作列表 鼠标支持以下操作: LButton          RButton          MButton         WheelDown           WheelUp        键盘按键支持以下操作: Space - the spac

13、ebar Tab Enter (or Return) Escape (or Esc) Backspace (or BS) Delete (or Del) Insert (or Ins) Home End PgUp PgDn Up Down Left Right ScrollLock CapsLock NumLock Numlock ON Numlock OFF Numpad0 NumpadIns Numpad1 NumpadEnd Numpad2 NumpadDown Numpad3 NumpadPgDn Numpad4 NumpadL

14、eft Numpad5 NumpadClear Numpad6 NumpadRight Numpad7 NumpadHome Numpad8 NumpadUp Numpad9 NumpadPgUp NumpadDot (.) NumpadDel NumpadDiv (/) NumpadDiv (/) NumpadMult (*) NumpadMult (*) NumpadAdd (+) NumpadAdd (+) NumpadSub (-) NumpadSub (-) NumpadEnter NumpadEnter 1            a 

15、     A          LWin              Control (or Ctrl)            Alt          Shift              F1 PrintScreen            CtrlBreak        Pause             Break AutoHotKey使用教程(七)-----AutoHotkey脚本 AutoHotkey跟tcl等语言一样,是一种解释性语言。从脚本的头部至结尾顺序执行,除非遇到return,exit或者热键、热字符串。 一个AutoHotkey脚本如果不包含热键、热字符串、O

16、nMessage或者 GUI等,就会在文件执行完成后推出,否则脚本会处于idle状态以备相应热键、热字符串等操作。 `的用法类似于c和tcl中的“\”,例如`t (tab), `n (linefeed), and `r (carriage return). Autohotkey中逗号和百分号都有专门的意义,如果要表示字符意义,可以使用`, `%。 MsgBox This is ok. MsgBox, This is ok too (it has an explicit comma).        AutoHotkey脚本使用“;”注释,“;”跟在需注释的语句之后,注意语句和分号之间

17、只要要有一个空格。如果要注意多个语句可以使用/* */ Run Notepad ; This is a comment on the same line as a command. /* MsgBox, This line is commented out (disabled). MsgBox, This one too. */     为了增加脚本的可读性和可维护性,有时需要将一个较长的语句拆分成几个较小的语句,可以使用以下几种方法: 1)    一行以"and", "or", ||, &&或者逗号开始,会自动跟上一句组合成一句。 FileAppend, This is t

18、he text to append.`n   ; A comment is allowed here. , %A_ProgramFiles%\SomeApplication\LogFile.txt ; Comment. if (Color = "Red" or Color = "Green" or Color = "Blue"   ; Comment.     or Color = "Black" or Color = "Gray" or Color = "White")   ; Comment. and ProductIsAvailableInColor(Product, Color

19、)   ; Comment. 2)这种方法适用于要连接很多行并且方法1不适用的情况。 ; EXAMPLE #1: Var = ( Line 1 of the text. Line 2 of the text. By default, a linefeed (`n) is present between lines. ) ; EXAMPLE #2: FileAppend, ; The comma is required in this case. ( A line of text. By default, the hard carriage return (Enter)

20、between the previous line and this one will be written to the file as a linefeed (`n).     By default, the tab to the left of this line will also be written to the file (the same is true for spaces). By default, variable references such        把所有要组合在一起的行放在一个圆括号内。               可以使用ahk2exe工具把S

21、cript 转换成 EXE文件(可以选用自己喜欢的图标)。也可以右键.ahk文件,选“Compile Script”进行编译。也可以使用命令行: Ahk2exe.exe /in MyScript.ahk [/out MyScript.exe][/icon MyIcon.ico][/pass password][/NoDecompile]        Pikka注意了一下,编译后文件会变的比较大。        AutoHotkey脚本允许设置断点,在需要设置断点的地方放上下面两句话就可以了,脚本运行到这个位置就会打印当前的变量。 ListVars Pause AutoHotK

22、ey使用教程(八)-----变量和表达式 AutoHotkey没有显示地定义一些变量类型,所有的变量都是字符串类型。 AutoHotkey里面的所有的变量都是全局变量,能被文件内任何位置引用。除非在函数里面声明的,是局部变量,只能在函数内部引用。AutoHotkey的变量不需要声明直接使用。 变量的名字不区分大小写,长度最长254个字母。 变量的存储有两种方法: 方法1:使用“=”去定义数字、没带引号的字符串和带%的变量 MyNumber = 123 MyString = This is a literal string. CopyOfVar = %Var% ; With th

23、e = operator, percent signs are required to retrieve a variable's contents. 方法2:使用“:=”去定义数字,带引号的字符串和不带%的变量 MyNumber := 123 MyString := "This is a literal string." CopyOfVar := Var ; Unlike its counterpart in the previous section, percent signs are not used with the := operator.        同样的,变量

24、的引用也有两种方法: 方法1: Var = 123 MsgBox The value in the variable named Var is %Var%. 方法2: var := 123 MsgBox % "The value in the variable named Var is " . Var . ""        表达式的两个例子 NetPrice := Price * (1 - Discount/100) if (CurrentSetting > 100 or FoundColor <> "Blue") MsgBox The setting is too hi

25、gh or the wrong color is present. AutoHotkey支持的运算符包括:%Var%、++ --、**、- ! ~ & *、* / //、+ -、<< >>、& ^ |、. 、>    < >= <=、= == <> !=、NOT、AND &&、OR ||、?:、:= += -= *= /= //= .= |= &= ^= >>= <<=、, 、 mod()、round()、abs() 下面这些变量是内嵌在程序中,有特殊的含义,任何脚本都可以引用它们,只能读不能写。 Special Characters: A_Space, A_Tab Script P

26、roperties: command line parameters, A_WorkingDir, A_ScriptDir, A_ScriptName, (...more...) Date and Time: A_YYYY, A_MM, A_DD, A_Hour, A_Min, A_Sec, (...more...) Script Settings: A_IsSuspended, A_BatchLines, A_TitleMatchMode, (...more...) User Idle Time: A_TimeIdle, A_TimeIdlePhysical GUI Wind

27、ows and Menu Bars: A_Gui, A_GuiControl, A_GuiEvent, A_EventInfo Hotkeys, Hotstrings, and Custom Menu Items: A_ThisHotkey, A_EndChar, A_ThisMenuItem, (...more...) Operating System and User Info: A_OSVersion, A_ScreenWidth, A_ScreenHeight, (...more...) Misc: A_Cursor, A_CaretX, A_CaretY, Clipboa

28、rd, ClipboardAll, ErrorLevel Loop: A_Index, (...more...) AutoHotKey使用教程(九)-----函数 一个函数的简单的例子: Add(x, y) {     return x + y   ; "Return" expects an expression. }     函数调用时,变量的后面使用:= Var := Add(2, 3) ; 由于一个函数调用就是一个表达式,所以函数的参数列表里面的变量前面不能加百分号“%”,相反的,字符串要使用引号,请看下面的例子: if InStr(MyVar, "fox")

29、 MsgBox The variable MyVar contains the word fox.     当一个命令的参数调用函数的时候,如果命令的参数不支持表达式,就必须使用百分号“%”,请看下面的例子: MsgBox % "The answer is: " . Add(3, 2) 一个函数可以带参数也可以不带参数(类似C中的过程)。 函数的参数列表里的变量是局部变量,除非前面增加修饰符“ByRef”。 Swap(ByRef Left, ByRef Right) {     temp := Left     Left := Right     Right := temp

30、 }        在上面的例子中,参数列表里的变量前面加了修饰符“ByRef”,这样参数就成为了调用者传递的变量的引用,参数和调用者的变量就指向了内存中的同一块内容。(类似C中的传地址调用,如果不加修饰符“ByRef”,就是传值调用)        使用“ByRef”还可以使函数返回多于一个返回值。        AutoHotkey 函数支持可选参数,只要在可选参数的后面加个等号即可。 Add(X, Y, Z = 0) {     return X + Y + Z } 如果给函数传递了3个值,可选参数就被忽略,否则就使用默认值。 AutoHotkey里面也有局部变量,全

31、局变量,静态变量的概念,涵义跟C语法相同,用法类似,下面主要讲一下不同点: 函数内部在要使用全局变量的之前,必须再声明一下。 LogToFile(TextToLog) {     global LogFileName ; This global variable was previously given a value somewhere outside this function.     FileAppend, %TextToLog%`n, %LogFileName% } 如果有较多的全局变量,就可以在第一行使用global,这样就认为后面的变量都是全局变量。 SetDef

32、aults() {     global ; This word can be omitted if the first line of this function will be something like "local MyVar".     Var := 33 ; Assigns 33 to a global variable, first creating the variable if necessary.     local x, y:=0, z ; Local variables must be declared in this mode, otherwise they

33、 would be assumed global.     ; ...and so on. } 在定义变量的时候,同种类型的变量之间使用逗号隔开 global LogFileName, MaxRetries := 5 static TotalAttempts = 0, PrevResult 可以使用“#include”从外部文件引用函数。(是不是跟C很相似呢,呵呵) 函数使用return返回一个结果推出,也可以使用exit从当前线程中终止退出。 AutoHotKey使用教程(十)---Hotstring使用介绍 “Hotstring”我也不知道怎么翻译,姑且直译为“热字符

34、串”吧。        热字符串主要用来扩展缩写的功能(本质就是替换),当然你也可以用它来触发一些动作,在这一点上,它跟热键没有区别。 ::btw::by the way        在上面的例子中,缩写“btw”会自动的替换成“by the way”。(注意,在敲击btw之后,你要增加一个结束符,例如空格,回车和逗号等符号。        下面是一个热字符串用来触发动作的例子。 ::btw:: MsgBox You typed "btw". return        使用#IfWinActive/Exist可以实现环境敏感的热字符串,例如下面的例子 #IfWinActi

35、ve ahk_class Notepad ::btw::This replacement text will appear only in Notepad. #IfWinActive ::btw::This replacement text appears in windows other than Notepad.        如果要想在热字符串替换后加上空格,可以在语句的后边加上 `,例如: :*:btw::By the way ` 结束符说明: 1)默认的结束符包括:-()[]{}':;"/\,.?!`n `t 2)`n is Enter, `t is Tab 3)

36、注意上面的`n `t之间有个空格 4)用户可以自己定义结束符,方法如下: #Hotstring EndChars -()[]{}:;'"/\,.?!`n `t 选项说明: 可以通过修改选项修改Hotstring的默认行为,可以通过下面的两种方式修改 (1)       使用#Hotstring修改,它的作用域从当前位置开始到文件结束为止。 #Hotstring r c  ; All the below hotstrings will use "send raw" and will be case sensitive by default. ::al::airline ::CEO

37、Chief Executive Officer (2)把选项添加在第一对冒号的中间,只对本条Hotstring生效 :c*:j@::john@ ; Case sensitive and "ending character not required". (2)       常用选项 * :不需要终止符去触发Hotstring,使用*0选项关闭 ?:即使热字符串在另一个单词的中间,依然可以触发。关闭使用?0 C :大小写敏感,关闭使用c0 O :当热字符串生效时,不打印使用的终止符 Tips:        下面是Andreas Borutta写的一个小脚本,你可以使用它定义

38、自己的热键,只要是选中一个单词,然后使用“windows + H”快捷键即可,它会自动即时加载热键。 #h::  ; Win+H hotkey ; Get the text currently selected. The clipboard is used instead of ; "ControlGet Selected" because it works in a greater variety of editors ; (namely word processors).  Save the current clipboard contents to be ; restored

39、later. Although this handles only plain text, it seems better ; than nothing: AutoTrim Off  ; Retain any leading and trailing whitespace on the clipboard. ClipboardOld = %ClipboardAll% Clipboard =  ; Must start off blank for detection to work. Send ^c ClipWait 1 if ErrorLevel  ; ClipWait time

40、d out.     return ; Replace CRLF and/or LF with `n for use in a "send-raw" hotstring: ; The same is done for any other characters that might otherwise ; be a problem in raw mode: StringReplace, Hotstring, Clipboard, ``, ````, All  ; Do this replacement first to avoid interfering with the others

41、 below. StringReplace, Hotstring, Hotstring, `r`n, ``r, All  ; Using `r works better than `n in MS Word, etc. StringReplace, Hotstring, Hotstring, `n, ``r, All StringReplace, Hotstring, Hotstring, %A_Tab%, ``t, All StringReplace, Hotstring, Hotstring, `;, ```;, All Clipboard = %ClipboardOld%  ;

42、 Restore previous contents of clipboard. ; This will move the InputBox's caret to a more friendly position: SetTimer, MoveCaret, 10 ; Show the InputBox, providing the default hotstring: InputBox, Hotstring, New Hotstring, Type your abreviation at the indicated insertion point. You can also edit

43、the replacement text if you wish.`n`nExample entry: :R:btw`::by the way,,,,,,,, :R:`::%Hotstring% if ErrorLevel  ; The user pressed Cancel.     return IfInString, Hotstring, :R`::: {     MsgBox You didn't provide an abbreviation. The hotstring has not been added.     return } ; Otherwise, ad

44、d the hotstring and reload the script: FileAppend, `n%Hotstring%, %A_ScriptFullPath%  ; Put a `n at the beginning in case file lacks a blank line at its end. Reload Sleep 200 ; If successful, the reload will close this instance during the Sleep, so the line below will never be reached. MsgBox, 4

45、 The hotstring just added appears to be improperly formatted.  Would you like to open the script for editing? Note that the bad hotstring is at the bottom of the script. IfMsgBox, Yes, Edit return MoveCaret: IfWinNotActive, New Hotstring     return ; Otherwise, move the InputBox's insertion

46、point to where the user will type the abbreviation. Send {Home}{Right 3} SetTimer, MoveCaret, Off return AutoHotKey使用教程(十一)-----#IfWinActive / #IfWinExist命令 #IfWinActive / #IfWinExist主要用于创建上下文相关的热键和热字符串。比如你要创建的热键在不同的窗口执行不同的操作,都可以使用#IfWinActive / #IfWinExist。 #IfWinActive ahk_class Notepad #

47、space::MsgBox You pressed Win+Spacebar in Notepad. 可以讲#IfWinActive / #IfWinExist命令相当强大,大家可以使用这两个命令实现强大的功能。对应的相反的命令是#IfWinNotActive / #IfWinNotExist。        #IfWinActive / #IfWinExist命令格式:          #IfWinActive [, WinTitle, WinText] #IfWinExist [, WinTitle, WinText] 无参数 屏蔽掉热键和热字符串的上下文相关功能 WinT

48、itle 定义目标窗口的名字。也可以使用ahk_class关键字指明目标窗口的类型(可以使用Window Spy工具获得)。后面也可以跟ahk_pid and ahk_id指定该窗口AHK进程号。 WinText 该参数必须是目标窗口内容的一个字符串子集(在Window Spy工具有显示) 如果同种类型的多个窗口同时存在,pikka发现:只有在最近一个使用的窗口(Last Found Window),定义的热键才会生效。大家可以在下面的这个脚本试一下:       #IfWinExist ahk_class Notepad #n::WinActivate ; Activates t

49、he window found by #IfWin.     如果要去掉热键(或者热字符串)的上下文相关功能,可以使用带缺省参数的#IfWinActive。这样热键和热字符串可以在所有的窗口上都生效。 #IfWinActive 如果一个热键通过#IfWin命令失效,是指它执行正常的行为,就好像没有这个热键一样。 可以使用#IfWin方法在一个脚本中多次定义同一个热键和热字符串,这叫做热键变量。例如下面的例子: #IfWinActive ahk_class Notepad ^!c::MsgBox You pressed Control+Alt+C in Notepad. #IfWinActive ahk_class WordPadClass ^!c::MsgBox You pressed Control+Alt+C in WordPad. #IfWinActive ^!c::MsgBox You pressed Control+Alt+C in a window other than Notepad/WordPad. 如果同时多个热键变量都符合触发的条件,只有脚本最前面的变量才会触发。 如果想让创建的多个热键变量拥有一样的行为,可

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服