I want to monitor the keyboard to update my OSK with the new layout, currently i'm using the following code in a timer
It is work very fine but i ask if there is a better way than using timer, e.g. something like SetClipboardViewer
Code:
Private Sub tmrKBLayoutViewer_Tick(sender As Object, e As EventArgs) Handles tmrKBLayoutViewer.Tick
Static intPreviousHKL As IntPtr
Dim intCurrentHKL As IntPtr = GetCurrentLayoutID()
If intPreviousHKL <> intCurrentHKL Then
intPreviousHKL = intCurrentHKL
UpdateKeyboardLayout()
End If
End Sub