MouseAndKeyInput/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: MouseAndKeyInput/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | # A propos | |
| 2 | + | ||
| 3 | + | Le paquet MouseAndKeyInput est un outil multi-plateform de manipulation avec la souris et l'entrée clavier. Vous pouvez déplacer le curseur vers une position spécifiée, envoyer des clicks et simuler des pressions de touche. Il est approprié pour le test des IHM ou le contrôle de programme de démonstration | |
| 4 | + | ||
| 5 | + | # Emplacement | |
| 6 | + | ||
| 7 | + | lazarusdir/components/mouseandkeyinput | |
| 8 | + | ||
| 9 | + | # Auteur | |
| 10 | + | ||
| 11 | + | Tom Gregorovic | |
| 12 | + | ||
| 13 | + | # Licence | |
| 14 | + | ||
| 15 | + | GPL | |
| 16 | + | ||
| 17 | + | # Journal des changements | |
| 18 | + | ||
| 19 | + | - Version 0.1 | |
| 20 | + | ||
| 21 | + | # Restrictions | |
| 22 | + | ||
| 23 | + | - il n'est pas recommandé d'appeler la souris et les entrées clavier depuis des événements comme OnClick,, utilisez [[Asynchronous Calls/fr|Application.QueueAsyncCall]] à la place. | |
| 24 | + | - ne pas oublier de revenir sur l'état d'un bouton de souris et d'une touche après la méthode Down avec la méthode Up. | |
| 25 | + | ||
| 26 | + | ## Carbon | |
| 27 | + | ||
| 28 | + | - La pression sur les caractères alpha n'est pas supportée. | |
| 29 | + | ||
| 30 | + | ## Gtk1/2 | |
| 31 | + | ||
| 32 | + | - a besoin de la bibliothèque Xtst | |
| 33 | + | - La pression sur les ALT+touche n'est pas supportée. | |
| 34 | + | ||
| 35 | + | # Comment faire | |
| 36 | + | ||
| 37 | + | Avec votre projet ouvert : Allez dans le répertoire d'installation de Lazarus -\> components -\> mouseandkeyinput. | |
| 38 | + | ||
| 39 | + | Là vous trouverez : `lazmouseandkeyinput.lpk`. Ouvrez et compilez le .lpk. | |
| 40 | + | ||
| 41 | + | Dans votre unit.pas ajoutez dans la clause Uses : MouseAndKeyInput ,LCLType | |
| 42 | + | ||
| 43 | + | Pour simuler la pression de F1 depuis une touche : | |
| 44 | + | ||
| 45 | + | ``` pascal | |
| 46 | + | procedure TForm1.HelpButtonClick(Sender: TObject); | |
| 47 | + | begin | |
| 48 | + | KeyInput.Apply([ssCtrl]); | |
| 49 | + | KeyInput.Press(VK_F1); // This will simulate press of F1 function key. | |
| 50 | + | KeyInput.Unapply([ssCtrl]); | |
| 51 | + | end; | |
| 52 | + | ``` | |
| 53 | + | ||
| 54 | + | Les définitions VK sont trouvés ici : <http://lazarus-ccr.sourceforge.net/docs/lcl/lcltype/index-2.html> | |
| 55 | + | ||
| 56 | + | Contrôle de la souris : | |
| 57 | + | ||
| 58 | + | ``` pascal | |
| 59 | + | MouseInput.Click(mbLeft,[],300,300); // Left click on X:=300 , Y:=300 | |
| 60 | + | MouseInput.Click(mbRight,[],1365,2); // Right click on X:=1365 , Y:=2 | |
| 61 | + | ``` | |
| 62 | + | ||
| 63 | + | \ | |
| 64 | + | ||
| 65 | + | --- | |
| 66 | + | *From the Free Pascal wiki, page "MouseAndKeyInput/fr", as it stood on 2020-02-20 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
