Attribute VB_Name = "Keyboard" Option Explicit Public ResultKey As Integer 'Permet de faire appuyer sur des touches Declare Sub keybd_event _ Lib "user32" ( _ ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long) 'Utilisation : 'Simuler la pression sur la touche A 'keybd_event 65, 0, 0, 0 'Noubliez surtout pas de relacher la touche ! comme ceci : 'keybd_event 65, 0, 2, 0 'ResultKey = GetKeyState(116) Declare Function GetKeyState _ Lib "user32" ( _ ByVal nVirtKey As Long _ ) As Integer 'Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long 'Declare Function GetKeyboardLayoutList Lib "user32" (ByVal nBuff As Long, lpList As Long) As Long 'Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" (ByVal pwszKLID As String) As Long 'Declare Function GetKeyboardState _ Lib "user32" ( _ pbKeyState As Byte _ ) As Long 'Declare Function GetKeyboardType Lib "user32" (ByVal nTypeFlag As Long) As Long 'Declare Function GetKeyNameText Lib "user32" Alias "GetKeyNameTextA" (ByVal lParam As Long, ByVal lpBuffer As String, ByVal nSize As Long) As Long