Code: Select all
#SingleInstance Force
#Persistent
SetWorkingDir %A_WorkingDir%
ShowHotkeyHelp:
Includelist0 = 0
InclIdx = 0 ; for handling include files
splitpath, A_Scriptfullpath, ohname, ohdir, ohext, ohnameNE, ohdrv
HelpText := ""
On_air_flag=0
A20130124125417:
oldTrim := A_AutoTrim
AutoTrim, On
HlpSrcFile = %ohname%
Loop
{ fileReadline, thisline, %HlpSrcFile%, %A_Index%
If ErrorLevel
Break
; ignore single line comments
firstch := SubStr(thisline,1,1)
If (firstch = ";")
continue
; Ignore IfInString test lines
IfInString, thisline, IfInString
continue
;....................
; process rem comments
;IfInString, thisline, %beginBlockComment%
IfInString, thisline, /*
{ InComment = 1
Continue
}
;IfInString, thisline, %endBlockComment%
IfInString, thisline, */
{ InComment = 0
Continue
}
; handle a line within a block comment
If (InComment = 1)
Continue
; process hotkey command
; line as hotkey def there are two forms of a hotkey assignment. one uses the
; label Hotkey the other uses the double colon in the key assignment.
tempstr = %thisline% ;<-- to cause autotrim to activate
firstword := SubStr(tempstr,1,6)
;If (firstword = "Hotkey")
;{
; HelpText .= tempstr "`n"
; Continue
;}
; double colon hotkey or hotstring
IfInString, thisline, ::
{
HelpText .= thisline "`n", %HlpDestFile%
Continue
}
; process single line comment statement
IfInString, thisline, `;
Continue
; handle #include files this is so you can identify
; hotkeys from additional files
IfInString, thisline, #IncludeAgain ;<-- ignore multiple includes of the same file
Continue
IfInString, thisline, #Include
{ InclIdx++ ;<-- count the include file
IncludeList0 := IncIdx
inclstr := (SubStr(thisline, 10))
IncludeList%InclIdx% = %inclstr%
HelpText .= thisline %a_Index%`n, %HlpDestFile%
Continue
}
}
AutoTrim := oldtrim
; walk backwards through the include files
If (InclIdx > 0)
{ inclstr := IncludeList%InclIdx%
InclIdx--
Splitpath, InclStr,ohname,,,ohnameNE
HelpText .= Hotkeys included in %ohname%`r`n`r`n, %HlpDestFile%
Goto A20130124125417
}
StringReplace, HelpText, HelpText, Send,, All
StringReplace, HelpText, HelpText, !,ALT + `r, All
StringReplace, HelpText, HelpText, #,Windows Key + `r, All
StringReplace, HelpText, HelpText, ^,CTRL + `r , All
StringReplace, HelpText, HelpText, {Enter}, `n , All
StringReplace, HelpText, HelpText, {Tab 3}, `n , All
StringReplace, HelpText, HelpText, :, `r`r - , All
IfInString, HelpText, :
{
StringReplace, HelpText, DeleteLine, :, `r`r - , All
}
Gui, DeleteHotKeys: Show, w330 h140, Delete HotKeys
GameIndex := 0
loop, read, test hotkey.ahk
{
Game%A_Index% := A_LoopReadLine
Game0 = %A_Index%
}
Loop,%Game0%
List .= Game%A_Index% . "|"
Gui, DeleteHotKeys: Add, DropDownList, x16 y31 w300 vDeleteKey Choose1, %List%
Gui, DeleteHotKeys: Add, Text, x108 y6 w202 h23 +0x200, Select a HotKey to delete:
Gui, DeleteHotKeys: Add, Button, w63 x136 y58 gChoose, Delete
Gui, DeleteHotKeys: Show,,Delete HotKey
return
Choose:
Gui, DeleteHotKeys: Submit, Nohide
MsgBox, 36, Continue?, Are you sure you want to delete the selected HotKey? `r`r%DeleteKey%
IfMsgBox No
return
else
;FileRead(ReadToDelete, Keyboard.ahk)
Sleep 10
return
SetWorkingdir, %OldWorkingDir%
Return
; Only need the below to show
!a::Send Active Directory Account Unlock - CHI_CO
!d::Send Active Directory Password Reset - CHI_CO
!m::Send Millennium Account Unlock - CHI_CO