AutoHotKey : contrôlez Windows grâce à vos propres raccourcis clavier AutoHotKey: control Windows with your own keyboard shortcuts

auto-hot-key.jpg Nous avons vus récemment un We've seen recently logiciel de todo listes entièrement contrôlable au clavier todo list software fully controllable from the keyboard . . Que diriez-vous maintenant de contrôler l' ensemble de Windows grâce à vos propres raccourcis clavier ? How about now control the entire Windows with your own keyboard shortcuts?

Avec With AutoHotKey AutoHotKey , le rêve devient réalité. The dream becomes reality. C'est un langage de scripts facile à maîtriser pour créer toutes sortes de raccourcis clavier. It is a scripting language easy to learn to create all sorts of keyboard shortcuts. Une aubaine pour optimiser votre productivité. A boon to maximize your productivity.

Voici donc un tutoriel qui vous permettra de créer en un tour de main des raccourcis clavier très efficaces. Here is a tutorial that will allow you to create a twinkling keyboard shortcuts very effective.

Avant de commencer Before you begin

La première chose à faire est de The first thing to do is télécharger et installer le logiciel AutoHotKey Download and install AutoHotKey . . Ensuite, vous pourrez créer votre premier script en allant dans un répertoire, puis click droit > Nouveau > AutoHotKey Script Then, you can create your first script from a directory, then right click> New> AutoHotKey Script

Créer un nouveau script autohotkey

Renommez-le et cliquez avec le bouton droit de la souris dessus. Rename it and click the right button of the mouse. Choisissez Edit Script pour ouvrir le fichier dans le bloc notes Windows. Select Edit Script to open the file in Windows Notepad.

Votre premier Script Your First Script

Le plus simple est d'associer une touche à une autre. The easiest way is to bind a key to another. Par exemple si je veux que la touche a appelle la touche b , j'écrirai dans mon script la ligne suivante : For example if I want the key was called the b button, I will write in my script the following line:

a::b

Exécutez maintenant le script en double-cliquant dessus. Now run the script by double-clicking it. Désormais, si vous essayez d'écrire un a dans un éditeur, vous constaterez que vous obtenez un b à la place. Now, if you try to write one has an editor, you find that you get a B instead.

Evidemment, il ya des associations plus judicieuses. Obviously, there are more meaningful associations. Prenez par exemple la touche ² qui ne sert pas souvent. Take for example the square button that is not used often. Vous pouvez très bien l'associer à <Windows>+e afin d'ouvrir un explorateur Windows plus facilement : You can very well associate <Windows> + e to open a Windows Explorer more easily:

²::#e

Vous remarquerez ici que la touche <Windows> est représentée par un # . You'll notice here that the key <Windows> is represented by a #. On retrouve aussi des codifications spéciales pour certaines autres touches. There are also special coding for certain other keys.
Par exemple : !=Alt, ^=Control, +=Maj (voici la For example: "ALT = ^ = Control + Shift = (here is the liste complète complete list ). ).

Maintenant, comment vais-je faire pour utiliser la touche ² les rares fois où j'en ai besoin? Now, how am I going to use the square button on the rare occasions when I need it? Une solution peut être d'utiliser la touche Maj+² . One solution may be to use the Shift + ². Il suffit pour cela de rajouter dans notre script la ligne : Simply add to our script line:

+²::²

Des raccourcis clavier pour exécuter des commandes Keyboard shortcuts for executing commands

Pour aller plus loin, nous allons utiliser les raccourcis clavier pour exécuter des commandes simples. To go further, we'll use the keyboard shortcuts to execute simple commands.

Premier exemple : réduire une fenêtre grâce à la touche CapsLock . Example: shrink a window with the CapsLock. Nombreux sont ceux qui trouvent cette touche gênante : ne vous est-il jamais arrivé de taper une phrase entière sans vous rendre compte que vous aviez tapé accidentellement la touche CapsLock au milieu? Many people find this annoying key: do you ever come to type a whole sentence without realizing that you accidentally typed the CapsLock button in the middle? Ce script devrait supprimer ce problème : This script should remove this problem:

CapsLock::WinMinimize,A

Ici nous avons utilisé la commande WinMinimize avec le paramètre A , qui permet de minimiser la fenêtre active. Here we used the command WinMinimize with parameter A, which minimizes the active window.

Maintenant, essayons un raccourci clavier pour activer/désactiver le son grâce au raccourci clavier <Windows>-X . Now try a keyboard shortcut to enable / disable the sound through the keyboard shortcut <Windows>-X. Voici le code : Here's the code:

#x::SoundSet, +1, , mute

Désormais, plus besoin de cliquer sur l'icône haut parleur pour mettre en sourdine le son de windows, vos voisins vous en seront reconnaissant… Now, no need to click on the speaker icon to mute the sound of windows, your neighbors will thank you ...

Enfin, voici un code pour lancer un explorateur windows ouvert au répertoire Mes Documents : Finally, here is a code to launch a Windows Explorer to open My Documents folder:

#e::Run,C:\WINDOWS\explorer.exe /e`,%A_MyDocuments%

La commande Run permet d'exécuter n'importe quel programme windows. The Run command allows to run any windows program. Et même d'accéder à des adresses web. Even access to Web addresses.

Deux remarques sur cet exemple : Two remarks on this example:

  • Il est possible d'utiliser des variables. It is possible to use variables. Ici : %A_MyDocuments% correspond au chemin du répertoire Mes Documents (pour plus d'infos, consultez la Here: A_MyDocuments%% is the path to the My Documents folder (for more info, visit liste des variables internes de AutoHotKey list of internal variables AutoHotKey ). ).
  • Notez aussi le `, . Also note the `,. Le caractère ` est un caractère d' échappement . The `character is a character of exhaust. Vous avez dû noter que la virgule est utilisée comme séparateur dans les scripts AutoHotKey. You should note that the comma is used as separator in AutoHotKey scripts. Il faut donc faire précéder la virgule par un caractère spécial (caractère ` ) afin qu'elle soit vue non pas comme un séparateur mais comme un caractère normal (pour plus d'infos, consultez la It is therefore necessary to precede the comma with a special character ( `character) and be seen not as a separator but as a normal character (for more info, visit liste des caractères d'échappement List of escape characters ). ).

Créez des raccourcis plus complexes Create shortcuts more complex

Il est possible de créer des raccourcis qui appellent des procédures complexes sur plusieurs lignes. It is possible to create shortcuts that require complex procedures over several lines. Il faut alors utiliser la syntaxe suivante : It must then use the following syntax:

raccourci::
commande 1
commande 2

return

Voici par exemple un script qui vide la corbeille et affiche ensuite un message à l'utilisateur pour indiquer que la corbeille windows est vide : Here is an example script that empties the trash and then displays a message to the user to indicate that the Windows Recycle Bin is empty

#c::
FileRecycleEmpty, C:\
MsgBox, la corbeille est vide
return

Ici, la commande FileRecycleEmpty vide la corbeille du disque C, tandis que la commande MsgBox affiche un message à l'utilisateur. Here, the command FileRecycleEmpty empty the Recycle Bin on drive C, while the MsgBox command displays a message to the user.

Comment restreindre son raccourci à une application particulière How to restrict its shortcut to a particular application

Il est très utile de créer des raccourcis spécifiques à certaines applications. It is very useful to create shortcuts for specific applications. Pour cela, nous allons utiliser la directive #ifWinActive . For this, we will use the # ifWinActive. La syntaxe est la suivante : The syntax is as follows:

#ifWinActive fenêtre_concernée
Raccourci à créer
#ifWinActive

Voici par exemple un raccourci qui permet de créer un répertoire dans une fenêtre de l'explorateur Windows grâce au raccouci clavier <Windows>+N : Here, for example, a shortcut that creates a directory in a window of Windows Explorer using the keyboard shortcut <Windows> + N:

#IfWinActive ahk_class ExploreWClass
#n::
Send {Alt}f
Sleep 100
Send n
Sleep 100
Send {Enter}
return
#IfWinActive

La première chose à noter ici est le nom de la fenêtre : ahk_class ExploreWClass . The first thing to note here is the name of the window ahk_class ExploreWCIass. Vous trouverez facilement ce nom grâce à l'utilitaire Window spy qui se trouve dans votre répertoire d'installation d'AutoHotKey (fichier AU3_Spy.exe). You can easily find that name through the Window Spy utility located in your installation directory AutoHotKey (file AU3_Spy.exe).

Exécutez-le et cliquez sur la fenêtre voulue pour trouver son nom. Run it and click the window you want to find his name. Voici ce qu'on obtient : Here's what we get:

active-window-info.jpg

Si on revient au script, vous noterez que nous avons utilisé la commande Send , qui permet d'envoyer des touches à votre fenêtre. If we return to the script, you'll notice that we used the Send command, which lets you send keys to your window. Nous envoyons d'abord {Alt}f pour ouvrir le menu fichier. We will send first (Alt) f to open the file menu. Puis le temps que ce menu s'ouvre, on attend un petit moment avant d'envoyer de nouvelles touches grâce à la commande Sleep 100 (durée de 100 millisecondes). Then the time the menu opens, it waits a little while before sending new keys with the command Sleep 100 (duration of 100 milliseconds). Ensuite on envoie la touche n pour aller dans le sous-menu Nouveau et on valide à la fin par entrée pour créer le répertoire. Then it sends the n key to go to the New submenu and is valid at the entrance end to create the directory.

Exécutez vos scripts à partir d'une clé USB Run your script from a USB flash drive

Lorsque vous cliquez avec le bouton droit de la souris sur un script, vous verrez qu'il est possible de compiler le script en un fichier exécutable .exe When you click the right button mouse on a script, you'll see that it is possible to compile the script into an executable file. Exe

Ceci permet d'emporter avec vous votre programme et de l'exécuter sur d'autres ordinateurs à partir de votre clé USB. This can take with you your program and run it on other computers from your USB key. Vous avez donc l'assurance de retrouver vos raccourcis préférés lorsque vous travaillez sur d'autres ordinateurs. You have the assurance of finding your favorite shortcuts when you work on other computers.

Conclusion Conclusion

Même si AutoHotKey est très facile à utiliser, il n'en est pas moins puissant et efficace . Although AutoHotKey is very easy to use, it is nonetheless powerful and effective. On peut même créer de véritables applications avec. You can even create real applications. Il est possible de réaliser des substitutions de textes en cours de frappe - voir à ce propos l'application It is possible to make substitutions of text as you type - see on this application Texter Texter de Lifehacker dont nous avons parlé Lifehacker to whom we spoke précédemment previously - ainsi que de manipuler le presse-papier et de créer des fenêtres. - And to manipulate the clipboard and create windows.

Pour aller plus loin avec AutoHotKey, il sera bon d'aller faire un tour dans le To go further with AutoHotKey, it will be good to go for a walk in the forum Forum qui recèle des trésors de scripts. which contains a wealth of scripts.

Fans d'AutoHotKey, utilisez les commentaires pour nous faire part de vos astuces! Fans of AutoHotKey, use the feedback to give us your tips!

Tags: Tags: , , , , , , , , , , , , , ,

Articles similaires (en théorie) : Like (in theory):
Il ya un an sur C'éclair! A year ago on this Thread! - novembre 2007 - November 2007
Folder menu : l'outil d'accessibilité à tout faire Folder Menu: tool accessibility to everything
Pratique ce mémo! Practice this memo! - Les raccourcis clavier de FreeMind - Keyboard shortcuts for FreeMind
Mémo pratique : les raccourcis clavier de Windows Memo practice: the keyboard shortcuts in Windows
Contrôlez le volume sonore de Windows au clavier Control the sound volume in Windows keyboard

9 commentaires 9 comments » "

  1. Ayinn said, Ayinn said,

    Wrote on Wrote on décembre 14, 2007 @ 1:39 December 14, 2007 @ 1:39

    Très facile c'est vite dit, en tout cas pour moi qui ne touche rien en informatique ou presque. Very easy is easier said than done, at least for me that does not touch anything computer or almost. Par exemple, j'ai essayé de créer un raccourci qui vide la corbeille, eh bien, pour certains programmes, il ne les enlève pas, les musiques notamment. For example, I tried creating a shortcut to empty the trash, well, for some programs, it does not remove them, especially the music. Par ailleurs je ne comprends rien en ce qui concerne la commande elle-même. Also I do not understand regarding the command itself. FileRecycleEpmty ?? FileRecycleEpmty? Bien sûr après l'avoir vu et traduit on comprend mais on ne peut pas deviner la commande en elle même. Of course after seeing it and translated it includes but one can not guess the order itself.

    Merci de bien vouloir m'expliquer parce que bien sûr ce programme est très intéressant. Thank you kindly explain to me because of course this program is very interesting.

  2. Argancel Argancel said, said,

    Wrote on Wrote on décembre 14, 2007 @ 6:51 December 14, 2007 @ 6:51

    @Ayinn : merci pour ton commentaire. Ayinn @: thank you for your comment. Si tu veux mieux comprendre la commande FileRecycleEmpty , tu peux consulter la page qui explique la syntaxe de cette commande If you want to understand the command FileRecycleEmpty, you can visit the page that explains the syntax of this command ici here . . Notamment, tes musiques sont peut-être sur un autre disque que C:, dans ce cas il suffit donc d'appeler la commande sans le “, C:\” pour résoudre le problème. In particular, your music may be on another disk than C: in this case it suffices to invoke the command without the "C: \" to solve the problem.
    La liste de toutes les commandes est disponible The list of all commands is available ici here . .

  3. Jean-Denis Jean-Denis said, said,

    Wrote on Wrote on mars 13, 2008 @ 2:31 March 13, 2008 @ 2:31

    Dire que j'ai Googlé pendant trois semaines (depuis que j'essaie Autohotkey) avant de trouver cette sympathique page en français ! I say Google for three weeks (since I try AutoHotkey) before finding this nice page in French!
    Bravo, merci (car même après trois semaines j'y ai appris des choses Bravo, thank you (because even after three weeks I have learned things :-)
    Amicalement, Sincerely,
    ________Jidé ________Jidé

  4. Argancel Argancel said, said,

    Wrote on Wrote on mars 13, 2008 @ 8:18 March 13, 2008 @ 8:18

    @Jean-Denis : eh oui, pas toujours facile de trouver ce qu'on veut sur Google. @ Jean-Denis: yes, not always easy to find what you want on Google.
    Merci pour ton commentaire encourageant et bonne continuation. Thank you for your encouraging comment and good continuation.

  5. Jean-Denis Jean-Denis said, said,

    Wrote on Wrote on mars 13, 2008 @ 18:33 March 13, 2008 @ 18:33

    >> Merci (…) >> Thank you (...)

    Si tu veux, je peux envoyer (pour publication éventuelle ici) mes morceaux de code AHK ? If you want I can send (for possible publication here) my AHK code snippets?
    Amicalement, Sincerely,
    ________Jidé ________Jidé
    http://www.ptitrain.com http://www.ptitrain.com

  6. tahitibob said, tahitibob said,

    Wrote on Wrote on avril 24, 2008 @ 10:45 April 24, 2008 @ 10:45

    omg, le logiciel de mes reves… omg, the software of my dreams ...
    depuis le temps que je me dit que windows a vraiment pas assez de raccourcis clavier, je suis pressé de pouvoir tester ce soft ! since that time I said that windows was not really enough keyboard shortcuts, I'm eager to test this software!
    merci bcp thank you bcp

  7. smoke_fr said, smoke_fr said,

    Wrote on Wrote on septembre 7, 2008 @ 2:14 September 7, 2008 @ 2:14

    moi je joue a gta sa en resau et je voudre fer des racourci sur les commandes du jeux I was playing gta sa Resauant and I want iron on the shortcut commands Games
    par exemple je veu apier sur = pour ke sa me tappe /tazer (ki est une commandes dans le jeux) eg I seen aper ke = to me its Tappe / tazer (ki is a command in the game)

    si quelquin c comment fer mercie de me repondre svp if quelquin c how iron Please respond to me please

  8. Reuben Norris said, Reuben Norris said,

    Wrote on Wrote on novembre 13, 2008 @ 0:16 November 13, 2008 @ 0:16

    2jy4q1q3pnq617jl 2jy4q1q3pnq617jl

  9. Thaddeus Mckee Thaddeus Mckee said, said,

    Wrote on Wrote on janvier 9, 2009 @ 16:17 January 9, 2009 @ 16:17

    hi hi
    4ot2cmprctrogtse 4ot2cmprctrogtse
    good luck good luck


2 rétroliens 2 trackbacks

  1. Extra : manipulez efficacement vos fenêtres avec Nifty Windows (accessibilité, productivité, application portable) Extra: effectively handle your windows with Nifty Windows (accessibility, productivity, portable application)
  2. Génialissime : manipulez efficacement vos fenêtres avec Nifty Windows (accessibilité, productivité, application portable) Génialissime: effectively handle your windows with Nifty Windows (accessibility, productivity, portable application)

Comment RSS Comment RSS · · TrackBack URI TrackBack URI

Ajoutez un commentaire Add a comment

Nom : Name:

E-mail: E-mail:

Website: Website:

Comment: Comment: