AutoHotkey

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m (Make Ctrl+L select the address bar like every other browser)
m (Auto Focus Winamp Search Box)
Line 40: Line 40:
 
}
 
}
 
return
 
return
 +
</source>
 +
 +
===Make Ctrl+L focus the Winamp search box===
 +
<source lang="text">
 +
#If WinActive("ahk_exe winamp.exe") and WinActive("Media Library")
 +
^L::
 +
ControlFocus Edit1,A
 +
return
 +
#If
 
</source>
 
</source>
  

Revision as of 11:06, 11 February 2016

This tool is fabulous. Get it from here: http://www.autohotkey.com/

Contents

Attie's AHK Script

The following script is a combination of a couple of scripts I've seen: "kdestyle" and "Make Backspace in Windows 7 or Vista Explorer Go Up like XP Did".

kdestyle

Source

  • To move a window, press and hold the windows button, and then Left Click and drag.
  • To resize a window, press and hold the windows button, and then Right Clock and drag - resizes from the closest corner.
  • I changed it slightly, because they used the wrong hotkeys and added silly functions :)

Make Backspace in Windows 7 or Vista Explorer Go Up like XP Did

Source

  • Fixes a stupid mistake that Microsoft made

Make Ctrl+L select the address bar in explorer like every other browser

Source

  • Fixes a stupid decision that Microsoft made (try Alt+D)

Make Ctrl+W close Win8+ App Windows

#IfWinActive, ahk_class ApplicationFrameWindow
^W::
	Send !{f4}
	return
#IfWinActive

Auto Focus Winamp Search Box

I use AltGr+L to show/hide the media library... This has an issue with timings, so if your system is slow, try tweaking the sleep

~<^>!L UP::
	KeyWait LControl
	KeyWait RAlt
	KeyWait L
	sleep 50
	if WinActive("ahk_exe winamp.exe") and WinActive("Media Library") {
		ControlFocus Edit1,A
	}
	return

Make Ctrl+L focus the Winamp search box

#If WinActive("ahk_exe winamp.exe") and WinActive("Media Library")
^L::
	ControlFocus Edit1,A
	return
#If

Source

#NoTrayIcon
#SingleInstance force
 
	if (A_AhkVersion < "1.0.39.00") {
		MsgBox,20,,This script may not work properly with your version of AutoHotkey. Continue?
		IfMsgBox,No
		ExitApp
	}
	SetWinDelay,2
	CoordMode,Mouse
	return
 
#LButton::
	MouseGetPos,KDE_X1,KDE_Y1,KDE_id
	WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
	if KDE_Win
		return
	WinGetPos,KDE_WinX1,KDE_WinY1,,,ahk_id %KDE_id%
	loop {
		GetKeyState,KDE_Button,LButton,P
		if KDE_Button = U
			break
		MouseGetPos,KDE_X2,KDE_Y2
		KDE_X2 -= KDE_X1
		KDE_Y2 -= KDE_Y1
		KDE_WinX2 := (KDE_WinX1 + KDE_X2)
		KDE_WinY2 := (KDE_WinY1 + KDE_Y2)
		WinMove,ahk_id %KDE_id%,,%KDE_WinX2%,%KDE_WinY2%
	}
	return
 
#RButton::
	MouseGetPos,KDE_X1,KDE_Y1,KDE_id
	WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
	if KDE_Win
		return
	WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id%
	if (KDE_X1 < KDE_WinX1 + KDE_WinW / 2) {
		KDE_WinLeft := 1
	} else {
		KDE_WinLeft := -1
	}
	if (KDE_Y1 < KDE_WinY1 + KDE_WinH / 2) {
		KDE_WinUp := 1
	} else {
		KDE_WinUp := -1
	}
	loop {
		GetKeyState,KDE_Button,RButton,P
		if KDE_Button = U
			break
		MouseGetPos,KDE_X2,KDE_Y2
		WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id%
		KDE_X2 -= KDE_X1
		KDE_Y2 -= KDE_Y1
		WinMove,ahk_id %KDE_id%,, KDE_WinX1 + (KDE_WinLeft+1)/2*KDE_X2
		                        , KDE_WinY1 +   (KDE_WinUp+1)/2*KDE_Y2
		                        , KDE_WinW  -     KDE_WinLeft  *KDE_X2
		                        , KDE_WinH  -       KDE_WinUp  *KDE_Y2
		KDE_X1 := (KDE_X2 + KDE_X1)
		KDE_Y1 := (KDE_Y2 + KDE_Y1)
	}
	return
 
#IfWinActive, ahk_class CabinetWClass
Backspace::
	ControlGet renamestatus,Visible,,Edit1,A
	ControlGetFocus focussed, A
	if (renamestatus != 1 && (focussed = "DirectUIHWND3" || focussed = SysTreeView321)) {
		SendInput {Alt Down}{Up}{Alt Up}
	} else {
		Send {Backspace}
	}
	return
 
^L::
	Send !D
	return
#IfWinActive
 
#IfWinActive, ahk_class ApplicationFrameWindow
^W::
	Send !{f4}
	return
#IfWinActive
 
~<^>!L UP::
	KeyWait LControl
	KeyWait RAlt
	KeyWait L
	sleep 50
	if WinActive("ahk_exe winamp.exe") and WinActive("Media Library") {
		ControlFocus Edit1,A
	}
	return
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox