Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- #InstallKeybdHook
- ; #Warn
- SendMode Input
- SetWorkingDir %A_ScriptDir%
- ; Create Executable group for gameHotkey, IfWinActive
- global POEGameArr := ["PathOfExile.exe", "PathOfExile_x64.exe", "PathOfExileSteam.exe", "PathOfExile_x64Steam.exe", "PathOfExile_KG.exe", "PathOfExile_x64_KG.exe"]
- for n, exe in POEGameArr {
- GroupAdd, POEGameGroup, ahk_exe %exe%
- }
- Global 1Suffix1Text,1Suffix2Text,1Suffix3Text,1Suffix4Text,1Suffix5Text
- ; This GUI allows you to register primitive three-key combination hotkeys:
- Gui Add, Text, xm section, 1Prefix key:
- Gui Add, Edit, yp x100 w50 v1Prefix1, a
- Gui Add, Edit, yp x100 y+1 w50 v1Prefix2, s
- Gui Add, Text, xm section, 1Suffix hotkey:
- Gui Add, Edit, yp x100 w100 v1Suffix1, 1
- Gui Add, Edit, yp x100 y+1 w100 v1Suffix2, 2
- Gui Add, Edit, yp x100 y+1 w100 v1Suffix3, 3
- Gui Add, Edit, yp x100 y+1 w100 v1Suffix4, 4
- Gui Add, Edit, yp x100 y+1 w100 v1Suffix5, 5
- Gui Add, Edit, x+1 ys w100 v1Suffix1Text, /Hideout
- Gui Add, Edit, y+1 w100 v1Suffix2Text, /oos
- Gui Add, Edit, y+1 w100 v1Suffix3Text, 3
- Gui Add, Edit, y+1 w100 v1Suffix4Text, 4
- Gui Add, Edit, y+1 w100 v1Suffix5Text, 5
- Gui Add, Button, Default, Register1
- Gui Show
- return
- ButtonRegister1() {
- global
- If 1Suffix1
- Hotkey, *%1Suffix1%, off
- If 1Suffix2
- Hotkey, *%1Suffix2%, off
- If 1Suffix3
- Hotkey, *%1Suffix3%, off
- If 1Suffix4
- Hotkey, *%1Suffix4%, off
- If 1Suffix5
- Hotkey, *%1Suffix5%, off
- Gui Submit, NoHide
- local fn
- fn := Func("HotkeyShouldFire").Bind(1Prefix1,1Prefix2)
- Hotkey If, % fn
- Loop, 5 {
- If (1Suffix%A_Index%)
- keyval := 1Suffix%A_Index%
- Hotkey, *%keyval%, FireWhisperHotkey%A_Index%, On
- }
- }
- HotkeyShouldFire(1Prefix1, 1Prefix2, thisHotkey) {
- IfWinExist, ahk_group POEGameGroup
- {
- If ( 1Prefix1 && 1Prefix2 ){
- If ( GetKeyState(1Prefix1) && GetKeyState(1Prefix2) )
- return True
- Else
- return False
- }
- Else If ( 1Prefix1 && !1Prefix2 ) {
- If ( GetKeyState(1Prefix1) )
- return True
- Else
- return False
- }
- Else If ( !1Prefix1 && 1Prefix2 ) {
- If ( GetKeyState(1Prefix2) )
- return True
- Else
- return False
- }
- Else If ( !1Prefix1 && !1Prefix2 ) {
- return True
- }
- }
- Else {
- Return False
- }
- }
- FireWhisperHotkey1() {
- Tooltip, %A_ThisHotkey%
- Send, {Enter}%1Suffix1Text%{Enter}
- }
- FireWhisperHotkey2() {
- MsgBox %A_ThisHotkey%
- }
- FireWhisperHotkey3() {
- MsgBox %A_ThisHotkey%
- }
- FireWhisperHotkey4() {
- MsgBox %A_ThisHotkey%
- }
- FireWhisperHotkey5() {
- MsgBox %A_ThisHotkey%
- }
- GuiClose:
- GuiEscape:
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement