2009-09-02

AutoHotKey !F4 means pressing Alt first or together?

in this example, where i tried to define a special case to close Microsoft Mail indiviual mail window.

Numpad0::
IfWinActive ahk_class ATH_Note
{
Send !F4 ; close window
}
else
{
Send ^w ; close window
}
return

why would !F4 not work? Normally, pressing Ctrl+F4 would close the window. But it activates the menu instead (apparantly behaving as if Alt is pressed first, followed by F4, which Windows Mail ignores). ( ! c works though).

my question is, when i have syntax like !F4, does that always mean pressing Alt, release, then F4? Whats the syntaxt for pressing Alt and F4 together at the same time?

Thanks.

Xah ∑ http://xahlee.org/ ☄

2 comments:

  1. I know that this post is two months old now, but seeing as it is the second result on a Google search for "autohotkey f4" I figured I'd chime in.

    Wrap the F4 in curly braces.

    Numpad0::
    IfWinActive ahk_class ATH_Note
    Send !{F4} ; close window
    else
    Send ^w ; close window
    return

    ReplyDelete
  2. thanks, Dan. Your tip helped me out - kash

    ReplyDelete