Get The Type Of The Keyboard

'Insert this code to your form:

Private Declare Function GetKeyboardType Lib "user32" _
(ByVal nTypeFlag As Long) As Long

Private Sub Form_Load()
Dim t As String
Dim k As Long
k = GetKeyboardType(0)
If k = 1 Then t = "PC or compatible 83-key keyboard"
If k = 2 Then t = "Olivetti 102-key keyboard"
If k = 3 Then t = "AT or compatible 84-key keyboard"
If k = 4 Then t = "Enhanced(IBM) 101-102-key keyboard"
If k = 5 Then t = "Nokia 1050 keyboard"
If k = 6 Then t = "Nokia 9140 keyboard"
If k = 7 Then t = "Japanese keyboard"
MsgBox "Type of keyboard : " & t
End Sub

Go Back