410521a 发表于 2009-8-15 08:42:46

如果指定在某个窗口上指定的热键才能有效

; 捕获并传递按键事件
HotKeySet("{Esc}", "captureEsc")
Func captureEsc()
    ; 这里可定义要做的各种任务
    HotKeySet("{Esc}")
    Send("{Esc}")
    HotKeySet("{Esc}", "captureEsc")
EndFunc


这帮助我有看没有懂
HotKeySet("{END}", "tishiid")

FUNC tishiid();输入号码
        HotKeySet("{end}")
If WinActive("准备读取二代身份证信息,请刷卡!") Then
        SoundPlay("shuruid.wav",0)
        EndIf
   Send("{end}")
   HotKeySet("{end}", "tishiid")
TogglePAUSE()
EndFunc

afan 发表于 2009-8-15 10:47:24

HotKeySet("{Esc}", "captureEsc")
Func captureEsc()
If WinActive(指定的gui) Then
; 这里可定义要做的各种任务
Else
    HotKeySet("{Esc}")
    Send("{Esc}")
    HotKeySet("{Esc}", "captureEsc")
Endif
EndFunc

杨永全 发表于 2010-2-12 14:56:27

使用这个例子出现的问题请教大家:
func notepad()
; 捕获并传递按键事件
    ; ... 这里可定义要做的各种任务
if WinActive("无标题 - 记事本") then
msgbox(0,""," 记事本")
else
    HotKeySet("!x")
    Send("!x")
    HotKeySet("!x", "notepad")
endif
EndFunc




运行后,当在非记事本窗口按下该热键后,在按tab键的时候,便出现类似按下alt加tab的效果,不知如何解决?
页: [1]
查看完整版本: 如果指定在某个窗口上指定的热键才能有效