Sign in Join
Wiki copytemporary

MouseAndKeyInput/fr

English · Français

A propos

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

Emplacement

lazarusdir/components/mouseandkeyinput

Auteur

Tom Gregorovic

Licence

GPL

Journal des changements

Restrictions

Carbon

Gtk1/2

Comment faire

Avec votre projet ouvert : Allez dans le répertoire d'installation de Lazarus -> components -> mouseandkeyinput.

Là vous trouverez : lazmouseandkeyinput.lpk. Ouvrez et compilez le .lpk.

Dans votre unit.pas ajoutez dans la clause Uses : MouseAndKeyInput ,LCLType

Pour simuler la pression de F1 depuis une touche :

pascal
procedure TForm1.HelpButtonClick(Sender: TObject);
begin
  KeyInput.Apply([ssCtrl]);
  KeyInput.Press(VK_F1);                // This will simulate press of F1 function key.
  KeyInput.Unapply([ssCtrl]); 
end;

Les définitions VK sont trouvés ici : http://lazarus-ccr.sourceforge.net/docs/lcl/lcltype/index-2.html

Contrôle de la souris :

pascal
  MouseInput.Click(mbLeft,[],300,300);   // Left click on X:=300 , Y:=300
  MouseInput.Click(mbRight,[],1365,2);   // Right click on X:=1365 , Y:=2

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.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.