Me deram a dica de usar KEYLOGGER.
Mas não estou conseguindo. Preciso que o programinha fique em segundo plano, e ao acionar a tecla ñ seja substituida por ~. Ou mesmo aparecer uma janelinha onde solicita a tecla que deseja substituir no teclado.
Dê uma olhada. A intenção é que trocaria a letra ao digitar, em qualquer programa.
Módulo
Attribute VB_Name = "Module1"
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Sub main()
Form1.Show
End Sub
FORM1
Option Explicit
Private KeyAscii As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
txtmoitas.Text = ""
End Sub
Private Sub Timer1_Timer()
CheckForKeyPress
End Sub
Sub CheckForKeyPress()
With txtmoitas
If GetAsyncKeyState(vbKeyN) Then
'If txtmoitas = "ñ" Then
If KeyAscii = Asc("ñ") Then
End If
End If
End With
End Sub
End Sub