Firefox 4 and AutoHotkey: MozillaWindowClass

By Xah Lee. Date:

Firefox 4 is released today.

If you use AutoHotkey, you'll notice that Firefox's โ€œahk_classโ€ changed. It was MozillaUIWindowClass, which is also used by Mozilla Thunderbird. But now for Firefox 4 it's MozillaWindowClass.

This is a good change. Because now you can define key sets separate for Firefox and Thunderbird, without resorting to using the window's title or other tricks.

Here is my Firefox keys.

;; -------------------
;; Mozilla Firefox 4 hotkeys

#IfWinActive ahk_class MozillaWindowClass
; #IfWinActive ahk_class MozillaUIWindowClass
; #IfWinActive Mozilla Firefox

NumpadDiv::Send ^{PgUp} ; previous tab
NumpadMult::Send ^{PgDn} ; next tab

Pause::Send ^w ; close window

; swap middle/right buttons
$RButton::MButton
$MButton::RButton
$XButton2::Send ^w ; close

^F12::
{
Send ^t
sleep 100
Send ^v
sleep 100
Send {Enter}
}
Return