HotIfWinActive - unhandled exception

Issue #100 closed
Winter Laite created an issue

Code:


HotIfWinActive("ahk_class Notepad")
Hotkey("^!e", "MyFuncForNotepad")  ; Creates a hotkey that works only in Notepad.

MyFuncForNotepad() {
    MsgBox("Hotkey works", "Test of HotIfWinActive")
}

Error message:

Message: Unable to find existing hotkey handler: MyFuncForNotepad

What: Keysharp.Core.Keyboard.Hotkey()

Analogous working AHK code:

HotIfWinActive("ahk_class Notepad")
Hotkey("^!e", MyFuncForNotepad)  ; Creates a hotkey that works only in Notepad.

MyFuncForNotepad(*) {
    MsgBox("Hotkey works", "Test of HotIfWinActive")
}

Comments (3)

  1. Log in to comment