Page 1 sur 1
[R] Blockinput et hotkeyset
Posté : jeu. 07 mai 2009 14:20
par benzo
Bonjour
je souhaite bloquer clavier et souris durant l'exécution d'un script mais pouvoir en sortir aussi à tout moment avec une touche spécifique (échap par exemple)
Code : Tout sélectionner
hotkeyset("{Esc}","quitter")
BlockInput(1)
splashtexton ("INFO", "installation en cours d'Acrobat reader version ...", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
run (@scriptdir&"\AdbeRdr90_fr_FR.exe ")
sleep(81000)
splashoff()
BlockInput(0)
Func quitter()
Exit
EndFunc
le "hotkeyset" ne fonctionne pas
j'ai vu sur forum anglais un udf
http://www.autoitscript.com/forum/index ... +hotkeyset
mais je comprends pas trop
quelqu'un pour m'expliquer

Re: Blockinput et hotkeyset
Posté : jeu. 07 mai 2009 15:16
par jbnh
Merci de prendre quelques secondes pour lire
les règles de présentation d'un message et d'éditer votre titre. (Après 19 messages.....)
Sinon pas de problème chez moi pour quitter...
Ou alors vous voulez dire que si vous bloquez le clavier, vous ne pouvez plus quitter en appuyant sur échap ?
Enfait je pense que dans ce cas tu es un peu coincé, c'est pour cela que la personne en question a mis :
;This is only for testing, so if anything go wrong, the script will exit after 10 seconds.
AdlibEnable("quitter", 10000)
Ou alors tu fais comme lui :
$hNotepad_Wnd = WinGetHandle("[REGEXPCLASS:Notepad.*]")
_BlockInputEx(2, "", "", $hNotepad_Wnd)
Qui mentionne que seul sur notepad le clavier est désactivé....
Re: Blockinput et hotkeyset
Posté : jeu. 07 mai 2009 15:32
par benzo
ok , dsl un oubli de ma part pour le titre ..jespère que tu t'en remettras
sinon merci pour la réponse
mais ce que je veux c'est tout bloqué ,sauf la touche ("{ESC}"
donc il m'avait semblé que l'exception était possible en faisant
Re: Blockinput et hotkeyset
Posté : jeu. 07 mai 2009 15:34
par jbnh
Re, oui je m'en remettrai très vite
Rajoute dans la fonction quitter : splashoff()
salut
Re: Blockinput et hotkeyset
Posté : jeu. 07 mai 2009 15:56
par benzo
ouais le spashoff je l'avais déja mis
mais c'est surtout ke j'ai dû prendre trop de rosé à midi
en retestant :
ca marche nikel
merci pour ta réactivité jbnh
Re: [R] Blockinput et hotkeyset
Posté : sam. 31 juil. 2010 14:39
par Elrick
Bonjour,
J'ai suivi ce post mais je n'arrive pas à reproduire l'interuption avec la touche Echap... voici le code :
Code : Tout sélectionner
#include <BlockInputEx.au3>
;================== Block All Example ==================
HotKeySet("{ESC}", "_Quit") ;This will fail due to keyboard blocking.
;Here we block *All* inputs - Mouse *and* Keyboard. The same as built-in BlockInput() function.
_BlockInputEx(1, "{Esc}", "","")
splashtexton ("INFO", "Installation de Winamp en cours d'Acrobat ... ", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
;Script will UnBlock the inputs and exit after 5 seconds.
Sleep(5000)
_BlockInputEx(0)
Exit
Func _Quit()
splashoff()
Exit
EndFunc
Merci pour vos conseils.