Code: Select all
global HTMLKeys := {"^XButton1" : "^]"
,"^XButton2" : "^["
,"^Numpad7" : "<link href=""./resources/css/style.css"" type=""text/css"" rel=""stylesheet"">"
,"<!Left" : "{Home}"
,"<!Right" : "{End}"
,"^RButton" : "^/"}
; Hotkey, IfWinActive, ahk_exe atom.exe
Hotkey, If, SubTitle := "HTML"
for index, value in HTMLKeys {
bf := Func("KeySet").bind(value)
Hotkey, % index, % bf, On
}
Hotkey, If
global CSSKeys := {"^NumpadDiv" : "border: 2px solid black;{Enter}"
,"^Numpad8" : "resources\images\"
,"^Numpad9" : "url(""../images/"");{Left 3}"}
; Hotkey, IfWinActive, ahk_exe atom.exe
Hotkey, If, SubTitle := "CSS"
for index, value in CSSKeys {
bf := Func("KeySet").bind(value)
Hotkey, % index, % bf, On
}
Hotkey, If
global JavaScriptKeys := {"^l" : "console.log(){Left}"
, "^Numpad7" : """"" : """""
,"^Enter" : "(function() {{Enter}});"}
; Hotkey, IfWinActive, ahk_exe atom.exe
Hotkey, If, SubTitle := "JavaScript"
for index, value in JavaScriptKeys {
bf := Func("KeySet").bind(value)
Hotkey, % index, % bf, On
}
Hotkey, If
KeySet(msg) {
SendInput, % msg
}
#If SubTitle := "HTML"
Enter::Send, {Enter}
#If
#If SubTitle := "CSS"
Enter::Send, {Enter}
#If
#If SubTitle := "JavaScript"
Enter::Send, {Enter}
#If
Code: Select all
MButton::
; This would be automatic according to WinTitle
++Toggle
If (Toggle = 1) {
SubTitle := "HTML"
AtomKeys("HTML")
} If (Toggle = 2) {
SubTitle := "CSS"
AtomKeys("CSS")
} If (Toggle = 3) {
SubTitle := "JavaScript"
AtomKeys("JavaScript")
Toggle = 0
}
Return
AtomKeys(Var) {
for index, value in %Var%Keys {
Hotkey, % index, Toggle
}
}
Return