Page 1 sur 1

copmment simuler l'apui d'un touche

Publié : sam. 20/mai/2006 19:54
par scaraber
salut
je cherche a simuler l'apuis d'un touche avec un programme comment faire ?
merci d'avance
a+
scaraber

Publié : sam. 20/mai/2006 20:08
par Droopy
Code de Demonio Ardente

Code : Tout sélectionner

; this function simulates a keypress with optional control, alt, and shift
ProcedureDLL SimulateKeyPress(vk, Delay, control, alt, shift)
  If control
    keybd_event_(#VK_CONTROL, 0, 0,0)
  EndIf
  If alt
    keybd_event_(#VK_MENU, 0,0,0)
  EndIf
  If shift
    keybd_event_(#VK_SHIFT, 0,0,0)
  EndIf
  keybd_event_(vk, 0,0,0)
  Delay(Delay)
  keybd_event_(vk, 0, #KEYEVENTF_KEYUP, 0)
  If control
    keybd_event_(#VK_CONTROL, 0, #KEYEVENTF_KEYUP,0)
  EndIf
  If alt
    keybd_event_(#VK_MENU, 0,#KEYEVENTF_KEYUP,0)
  EndIf
  If shift
    keybd_event_(#VK_SHIFT, 0,#KEYEVENTF_KEYUP,0)
  EndIf
EndProcedure

Publié : sam. 20/mai/2006 20:09
par Thyphoon
regarde là :
http://www.purearea.net/pb/CodeArchiv/French.html#9

Get&Send Key

j'ai testé ça fonctionne bien

Publié : sam. 20/mai/2006 20:13
par Thyphoon
Droopy a écrit :Code de Demonio Ardente
tu as été plus rapide que moi :P

Publié : sam. 20/mai/2006 21:18
par Droopy
Une minute plus rapide 8) :D

Publié : dim. 21/mai/2006 17:30
par scaraber
salut
merci beaucoup ceci ma grandemant aidé....
il me reste un probleme
quelle est le vk pour le slash ? #VK_SLASH ne marche pas
a+
scaraber