But I cant seem to get it to work.
I start out by looping through all the windows and saving the emulator window titles in an array. Then I check which one is #1 so that I can use that as my active window since the Control Send would go to #2.
(#3 is there temporarily since I am using it to test it on Calculator as well as Notepad)
The Functions work on Notepad, but they dont work on chrome, calculator or the emulator.
Can someone help me out?
Code: Select all
global GBANames:=[]
;WinGet, gbaid, List, Pokemon
WinGet, Window, List
Loop %Window%
{
Id:=Window%A_Index%
WinGetTitle, TVar , % "ahk_id " Id
IfInString, TVar, Pokemon
;tList.=TVar "`n" ;use this if you just want the list
GBANames.Push(TVar)
;Window%A_Index%:=TVar ;use this if you want an array
else
Sleep,1
}
;MsgBox %tList%
;MsgBox %Window1%
;MsgBox % GBANames[1]
;MsgBox % GBANames[2]
MsgBox % GBANames[1]
GBANames.Push("Calculator")
MsgBox % GBANames[3]
~Space::
ControlSend,, {Space}, % GBANames[2]
return
~NumPad1::
ControlSend,, {NumPad1}, % GBANames[3]
return
~NumPad2::
ControlSend,, {NumPad2}, % GBANames[3]
return
~NumPad3::
ControlSend,, {NumPad3}, % GBANames[3]
return
~NumPad4::
ControlSend,, {NumPad4}, % GBANames[2]
return
~NumPad5::
ControlSend,, {NumPad5}, % GBANames[2]
return
~NumPad6::
ControlSend,, {NumPad6}, % GBANames[2]
return
~NumPad7::
ControlSend,, {NumPad7}, % GBANames[2]
return
~NumPad8::
ControlSend,, {NumPad8}, % GBANames[2]
return
~NumPad9::
ControlSend,, {NumPad9}, % GBANames[2]
return
~enter::
ControlSend,, {enter}, % GBANames[2]
return
~right::
ControlSend,, right, % GBANames[2]
return
~left::
ControlSend,, left, % GBANames[2]
return
~up::
ControlSend,, up, % GBANames[2]
return
~down::
ControlSend,, down, % GBANames[2]
return