Buon giorno a tutti...

come indicato dal titolo,
sto cercando di intercettare i tasti digitati dall'utente durante l'esecuzione del codice
il linguaggio che intendo usare è Visual Basic 6.0.

ho gia provato con due tipologie di FUNZIONI
la SendKeys, gia pre compilata in VB e la keybd_event, compilata a "mano".

se qualcuno conosce il contrario del SendKey, il "GETKEYS" sarebbe meglio
ma anche come usare il keybd_event per intercettare va bene.

ESEMPIO DI SENDKEYS
codice:
Option Explicit
Rem creare il CommandButton "command1"

Private Sub Command1_Click()
 Rem INVIA DATI ALLA TASTIERA

 Command1.Caption = "interrompi"
 Dim ReturnValue, I
 ReturnValue = Shell("notepad.exe", 1)   ' Esegue iln ote.
 SendKeys " » ATTENDERE IL 255 « " & "{ENTER}", True ' Invia sequenze di tasti
  For I = 1 To 255   ' Imposta il ciclo di conteggio.
  TEMPOSEC (0.3)
   SendKeys I & "; ", True   ' Invia Indice nel Note.
    If (I Mod 20) = 0 Then
     Rem inserishi INVIO nei comandi vbKeyReturn
     SendKeys "{ENTER}", True   ' Invia Invio per tabulzione))
    End If
  Next I   ' ciascun valore di I.
 SendKeys "{ENTER}" & " » completato «" 'operazione completata
 TEMPOSEC (1)
 SendKeys "%{F4}", True   ' Invia ALT+F4 per uscire dalla Calcolatrice.
 TEMPOSEC (1)
 SendKeys "{N}", True   ' Invia N di NO per salvate.
 Command1.Caption = "completato"
 Rem chiudi operazione
 TEMPOSEC (1)
 End
End Sub
ESEMPIO DI keybd_event
codice:
Option Explicit
Rem creare il CommandButton "command1"
Rem creare la ListBox "list1"
Rem creare il Timer "timer1"

Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Sub Command1_Click()
 Rem INVIA DATI ALLA TASTIERA
 Const KEYEVENTF_EXTENDEDKEY = &H1
 Const KEYEVENTF_KEYUP = &H2
 Command1.Caption = "interrompi"
 Dim ReturnValue, I
 ReturnValue = Shell("notepad.exe", 1)   ' Esegue il note.
 keybd_event Asc(" "), 0, 1, 0    '  Invia sequenze di tasti
 keybd_event Asc("A"), 0, 1, 0     '  Invia sequenze di tasti
 keybd_event Asc("T"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("T"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("T"), 0, 0, 0     '  Invia sequenze di tasti
 keybd_event Asc("T"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("E"), 0, 1, 0     '  Invia sequenze di tasti
 keybd_event Asc("N"), 0, 1, 0    '  Invia sequenze di tasti
 keybd_event Asc("D"), 0, 1, 0    '  Invia sequenze di tasti
 keybd_event Asc("I"), 0, 1, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 1, 0    '  Invia sequenze di tasti
 keybd_event Asc("I"), 0, 1, 0    '  Invia sequenze di tasti
 keybd_event Asc("L"), 0, 1, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("1"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("1"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("0"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("0"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 2, 0    '  Invia sequenze di tasti
 For I = 0 To 9   ' Imposta il ciclo di conteggio.
  TEMPOSEC (0.3)
  keybd_event Asc(I), 0, 0, 0    '  Invia sequenze di tasti
  keybd_event Asc(I), 0, 2, 0    '  Invia sequenze di tasti
  keybd_event Asc(" "), 0, 1, 0    '  Invia sequenze di tasti
 Next I   ' ciascun valore di I.
 keybd_event Asc(" "), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("F"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("F"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("I"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("I"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("N"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("N"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("I"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("I"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("T"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("T"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc("O"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("O"), 0, 2, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc(" "), 0, 2, 0    '  Invia sequenze di tasti
 TEMPOSEC (1)
 keybd_event vbKeyMenu, 0, 0, 0    '  Invia sequenze di tasti
 keybd_event vbKeyF4, 0, 0, 0    '  Invia sequenze di tasti
 keybd_event vbKeyF4, 0, 2, 0    '  Invia sequenze di tasti
 keybd_event vbKeyMenu, 0, 2, 0    '  Invia sequenze di tasti
 TEMPOSEC (1)
 keybd_event Asc("N"), 0, 0, 0    '  Invia sequenze di tasti
 keybd_event Asc("N"), 0, 2, 0    '  Invia sequenze di tasti
 Command1.Caption = "completato"
 Rem chiudi operazione
 TEMPOSEC (1)
End
End Sub

Private Sub List1_Click()
 Rem RICEVI DATI DALLA TASTIERA
 Rem avvia o termina la ricerca dei dati
 Timer1.Interval = 250
 Timer1.Enabled = Not Timer1.Enabled
 If Timer1.Enabled = True Then
  Rem operazione all'inizio dell'attesa
  Beep
  List1.Clear 
  List1.AddItem "avviato", 0
  List1.AddItem "", 0
 Else
  Rem operazione termine dell'attesa
  Beep
  List1.AddItem "» FINE «", 0
 End If
End Sub

Private Sub Timer1_Timer() ' {█ area importante █}
 Rem RICERCA DATI DALLA TASTIERA
 Dim UN, DU, TR, QU
 keybd_event UN, DU, TR, QU
 List1.AddItem UN + " ; " + DU + " ; " + TR + " ; " + QU + " ; "
End Sub  {█ area importante █}

Private Sub TEMPOSEC(MaXSeC As Double)
 'temporizzazione calcolo
 Dim PauseTime, Start, Finish, TotalTime
 PauseTime = MaXSeC  ' Imposta la durata.
 Start = Timer   ' Imposta l'ora di inizio.
 Do While Timer < Start + PauseTime
 DoEvents      ' Passa il controllo ad altri processi.
 Loop
 Finish = Timer   ' Imposta l'ora di fine della pausa.
 TotalTime = Finish - Start   ' Calcola il tempo totale.
 Form1.Caption = Form1.Caption + " -> " + (CurDir("")) 'restituzione directory iniziale
End Sub
Grazie ancora per la pazienza