2016-08-03 3 views
-1

프로그램을 시작하자 마자 바로 F11 키를 눌러야합니다. 실행시 단축키 또는 기본적으로 자동 키를 누르지 않아도됩니다. 여기 내 코드는 다음과 같습니다.AutoHotKey - 프로그램 시작시 단일 키 누르기

; This section fullscreens XENIA on Play 
#SingleInstance, Force 

numpad0:: 
IfWinExist, ahk_class XeniaWindowClass ahk_exe xenia.exe 
{ 
    WinActivate, ahk_class XeniaWindowClass 
    #IfWinActive, ahk_class XeniaWindowClass 
    { 
     Send, {F11} 
    } 
} 
return 

도움이 되었으면 감사합니다.

+0

코드가 "작동하지 않는 방법"에 대해 자세히 설명해 주실 수 있습니까? 당신은 무엇을 기대하고 있었고 실제로 무슨 일이 일어 났습니까? 이 세부 정보를 입력하거나 편집하지 않으면 도움이되지 않을 수 있습니다. –

+0

이전 게시물에 대한 내 답변보기. – user3419297

+0

물론, 내 프로그램이 기본적으로 창을 시작하고 내 프로그램이 F11 (프로그램 전체 화면)을 프로그램에 보내 자마자 코드가 잠겨서 전체 화면으로 표시되도록합니다. 지금 내 코드에서 볼 수 있듯이 numpad0 ::을 포함하여 코드를 테스트했지만 키를 누르기를 원하지는 않습니다.이 모든 것이 시작될 때 자동으로 수행되기를 바랍니다. – IanB

답변

0

아, 알겠습니다. 그렇다면 이것이 당신이하는 방법입니다. (프로그램을 실행 한 후이 스크립트를 실행하거나 이전 게시물에 대한 내 대답을 참조해야하지만) 당신은 기능을 실행하고 또한 numpad0을 눌러 호출 할 수 있습니다 :

; This section fullscreens XENIA on Play 
#Persistent 
#SingleInstance, Force 

GoSub, DoIt 
return 

numpad0:: 
GoSub, DoIt 
return 

DoIt: 
IfWinExist, ahk_class XeniaWindowClass ahk_exe xenia.exe 
{ 
    WinActivate, ahk_class XeniaWindowClass 
    #IfWinActive, ahk_class XeniaWindowClass 
    { 
     Send, {F11} 
    } 
} 
return 

제 H, LMK입니다. . .

+0

@IanB 다른 게시물에 대한 답변도 작성했습니다. – PGilm

0

어쩌면 이렇게 할 수 있을까요?

#Persistent 
SetTimer, XeniaWatcher 

XeniaWatcher() { 
    WinWaitActive, ahk_class XeniaWindowClass 
    Send, {F11} 
    WinWaitNotActive, ahk_class XeniaWindowClass 
} 

아니면?

#Persistent 
SetTimer, XeniaWatcher 

XeniaWatcher() { 
    WinWaitActive, ahk_class XeniaWindowClass 
    Send, {F11} 
    WinWaitClose, ahk_class XeniaWindowClass 
} 
+0

그 사람이 내게 이걸 준다 : http://i.imgur.com/mq56Exs.png – IanB

+0

당신의 AHK가 오래되었다. – Forivin