Page 1 of 1

Juste une touche répéter plusieurs fois

Posted: 11 Mar 2023, 18:33
by WynstProfil
Bonjour à tous,

je m'y perd dans ses histoires de scripts
Ce serais possible svp qu'une personne me fasse un script tout simple juste pour qu'une touche "T" se répète toutes les 10 secondes par exemple
Il y'a pas de touche de fin car une fois fini au pire je met fin au programme directement en l'arrêtant tout simplement
Mais juste un script simple concernant la répétition d'une touche toutes les 10 secondes

je vous dit merci d'avance

Re: Juste une touche répéter plusieurs fois

Posted: 12 Mar 2023, 05:55
by garry
deux exemples

Code: Select all

#Warn
#Singleinstance,force
setworkingdir, %a_scriptdir%
Process,Exist,notepad.exe
;- run notepad for test 
If Not ErrorLevel
  Run,notepad
return
;--------
$t::
Send {Blind}T
sleep,2000    ;- envoyer toutes les 2 secondes
return
;--------
esc::exitapp
;============

Code: Select all

#Warn
#Singleinstance,force
setworkingdir, %a_scriptdir%
act:=1
Process,Exist,notepad.exe
;- run notepad for test 
If Not ErrorLevel
  Run,notepad
sc:="ahk_exe notepad.exe" 
global act
return
;--------
$F8::                  ;- start
act:=1
IfWinNotExist, ahk_exe notepad.exe
 Run, notepad.exe
IfWinNotActive ,%sc%,,WinActivate,%sc%
      WinWaitActive,%sc%
While, act A1()
Return
A1() 
{	
loop
	{
    send,{text}T
    sleep,2000           ;- 2 second pour test
	}
	Until, !act
}
return
;---------------
$F9::                   ;- stop
act:=0
return
;--------------
esc::exitapp
;==============

Re: Juste une touche répéter plusieurs fois

Posted: 12 Mar 2023, 10:03
by WynstProfil
Merci bien
Met la T touche ne s'active pas, j'ai pourtant bien enregistré le script en .ahk et lancer avec Autohotkey (dernière version) mais ca met juste un temps d'arrêt sans que la lettre 'T' apparaisse

Re: Juste une touche répéter plusieurs fois

Posted: 12 Mar 2023, 12:07
by garry
vous pouvez demander dans "Ask for Help (v2)" , ahk dernière version
viewforum.php?f=82
traducteur :
https://translate.google.com/?sl=fr&tl=en