The problem with assigning hotkeys to Pidgin is that the GTK system assigns all the window names similarly - and Pidgin makes the conversation window have the title with the name of the person you are currently talking to. So I wrote up a function that assigns Alt+P to switch to the Pidgin conversation window. (I'm using the Pidgin hotkeys plugin to assign a hotkey to open/close the buddy list)
!p::
{
DetectHiddenWindows, Off
SetTitleMatchMode,2
IfWinActive,ahk_class gdkWindowToplevel
{
IfWinActive Buddy List
{
}
Else
{
PostMessage, 0x112, 0xF020,,, ahk_class gdkWindowToplevel, ; 0x112 = WM_SYSCOMMAND, 0xF020 = SC_MINIMIZE
}
}
Else
{
DetectHiddenWindows, Off
SetTitleMatchMode,2
IfWinExist, ahk_class gdkWindowToplevel,,Buddy List
{
WinActivate
}
}
Return
}
This function isn't perfect, though - if the buddy list is currently active, you have to hide it before switching to the conversation window. If anybody can suggest a better way to do it, please respond!
Couldn't you change that IfWinActive to this:
IfWinNotActive Buddy List
PostMessage, 0x112, 0xF020,,, ahk_class gdkWindowToplevel, ; 0x112 = WM_SYSCOMMAND, 0xF020 = SC_MINIMIZE
Would make the code shorter.
This is a good one. Glad you figured out how to do it cause I could never get it to work right.
Where is the hotkeys plugin at?
@Earel
Install AutoHotkey, then New -> AutoHotkey script from the context menu. Then paste it in, save, and double click on it.
You must log in to post.