-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 797d953
Showing
8 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#Include, HelperFunctions.ahk | ||
|
||
initCommands: | ||
; === Add Commands Here === | ||
global CommandArray := ["reload", "stop", "help"] | ||
CommandArray := sortArray(CommandArray) | ||
global CommandCount := CommandArray.MaxIndex() | ||
global commandArrayString := Join("|", CommandArray*) | ||
Return | ||
|
||
reload: | ||
Reload | ||
return | ||
|
||
stop: | ||
ExitApp | ||
return | ||
|
||
help: | ||
MsgBox, , Autohotkey Shell Help, % "Available Commands:`n - " + Join("`n - ", CommandArray*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | ||
; #Warn ; Enable warnings to assist with detecting common errors. | ||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | ||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | ||
|
||
#IfWinActive ahk_class classFoxitReader | ||
^t:: | ||
SendInput {Esc}{Alt}y1 | ||
Sleep 250 | ||
SendInput yb | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
sortArray(arr,options="") { ; specify only "Flip" in the options to reverse otherwise unordered array items | ||
|
||
if !IsObject(arr) | ||
return 0 | ||
new := [] | ||
if (options="Flip") { | ||
While (i := arr.MaxIndex()-A_Index+1) | ||
new.Insert(arr[i]) | ||
return new | ||
} | ||
For each, item in arr | ||
list .= item "`n" | ||
list := Trim(list,"`n") | ||
Sort, list, %options% | ||
Loop, parse, list, `n, `r | ||
new.Insert(A_LoopField) | ||
return new | ||
|
||
} | ||
|
||
; Joins a string array together | ||
Join(sep, params*) { | ||
for index,param in params | ||
str .= param . sep | ||
return SubStr(str, 1, -StrLen(sep)) | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | ||
; #Warn ; Enable warnings to assist with detecting common errors. | ||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | ||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | ||
|
||
CoordMode, ToolTip, Screen | ||
global numLockOn := GetKeyState("NumLock", "T") | ||
displayNumLock() | ||
Gosub, initCommands | ||
Gosub, createGUI | ||
|
||
#Include, CommandList.ahk | ||
|
||
; Removes Tooltip | ||
removeTooltip: | ||
ToolTip | ||
return | ||
|
||
; Changes Icon and Displays Tooltip, acording to numLockOn | ||
displayNumLock(){ | ||
If (numLockOn = 1){ | ||
ToolTip, Numbers active, A_ScreenWidth, A_ScreenHeight-55 | ||
Menu, Tray, Icon, Icons/num_1.ico | ||
}else{ | ||
ToolTip, Functions active, A_ScreenWidth, A_ScreenHeight-55 | ||
Menu, Tray, Icon, Icons/fun_F.ico | ||
} | ||
SetTimer, removeTooltip, -3000 | ||
return | ||
} | ||
|
||
; initializes the gui for later use | ||
createGUI: | ||
global ASH_Input_Box | ||
global ASH_Input_List_Index | ||
Gui, ASH:New,,Autohotkey SHell | ||
Gui, ASH:Add, Edit, r1 vASH_Input_Box gASH_Input_Change, | ||
Gui, ASH:Add, ListBox, r5 vASH_Input_List_Index +AltSubmit, %CommandArrayString% | ||
GuiControl, Choose, ASH_Input_List_Index, 1 | ||
return | ||
|
||
ASH_Input_Change: | ||
GuiControlGet, ASH_Input_Box, ASH: | ||
GuiControl, ChooseString, ASH_Input_List_Index, %ASH_Input_Box% | ||
return | ||
|
||
#IfWinActive, Autohotkey SHell | ||
Enter:: | ||
Gui, ASH:Submit | ||
Gosub, % CommandArray[ASH_Input_List_Index] | ||
return | ||
|
||
Down:: | ||
GuiControlGet, curIndex, ASH:, ASH_Input_List_Index, | ||
curIndex := curIndex + 1 | ||
if (curIndex > CommandCount){ | ||
curIndex := CommandCount | ||
} | ||
GuiControl, ASH:Choose, ASH_Input_List_Index, %curIndex% | ||
return | ||
|
||
Up:: | ||
GuiControlGet, curIndex, ASH:, ASH_Input_List_Index, | ||
curIndex := curIndex - 1 | ||
if (curIndex <= 0){ | ||
curIndex := 1 | ||
} | ||
GuiControl, ASH:Choose, ASH_Input_List_Index, %curIndex% | ||
return | ||
|
||
Tab::return | ||
|
||
Escape:: | ||
Gui, ASH:Hide | ||
return | ||
|
||
#IfWinActive | ||
|
||
; Change NumLock State (numLockOn) | ||
NumLock:: | ||
numLockOn := !numLockOn | ||
SetNumLockState, %numLockOn% | ||
displayNumLock() | ||
return | ||
|
||
; Show GUI | ||
NumpadIns:: | ||
GuiControl, ASH:Choose, ASH_Input_List_Index, 1 | ||
GuiControl, ASH:Text, ASH_Input, | ||
Gui, ASH:Show,, | ||
return |