Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27203

Monitor keyboard layout change

$
0
0
I want to monitor the keyboard to update my OSK with the new layout, currently i'm using the following code in a timer
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

It is work very fine but i ask if there is a better way than using timer, e.g. something like SetClipboardViewer

Viewing all articles
Browse latest Browse all 27203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>