Retrieves information about the current keyboard
#include <WinAPISys.au3>
_WinAPI_GetKeyboardType ( $iType )
$iType | The type of keyboard information to be retrieved, valid values: 0 - Keyboard type. 1 - Keyboard subtype (original equipment manufacturer (OEM)-dependent value). 2 - The number of function keys on the keyboard. |
Success: | The value that specifies the requested information. If $iType is 0, return value may be one of the following values. 1 - IBM PC/XT or compatible (83-key) keyboard. 2 - Olivetti "ICO" (102-key) keyboard. 3 - IBM PC/AT (84-key) or similar keyboard. 4 - IBM enhanced (101- or 102-key) keyboard. 5 - Nokia 1050 and similar keyboards. 6 - Nokia 9140 and similar keyboards. 7 - Japanese keyboard. Zero is a valid return value when $iType is one (keyboard subtype). |
Failure: | 0, call _WinAPI_GetLastError() to get extended error information. |
When a single USB keyboard is connected to the computer, this function returns the code 81.
Search GetKeyboardType in MSDN Library.
#include <WinAPISys.au3>
Local $sText
Local $iData = _WinAPI_GetKeyboardType(0)
Switch $iData
Case 1
$sText = 'IBM PC/XT or compatible (83-key) keyboard'
Case 2
$sText = 'Olivetti "ICO" (102-key) keyboard'
Case 3
$sText = 'IBM PC/AT (84-key) or similar keyboard'
Case 4
$sText = 'IBM enhanced (101- or 102-key) keyboard'
Case 5
$sText = 'Nokia 1050 and similar keyboards'
Case 6
$sText = 'Nokia 9140 and similar keyboards'
Case 7
$sText = 'Japanese keyboard'
EndSwitch
ConsoleWrite('Type : ' & $sText & @CRLF)
ConsoleWrite('Subtype: ' & _WinAPI_GetKeyboardType(1) & @CRLF)
ConsoleWrite('F-keys : ' & _WinAPI_GetKeyboardType(2) & @CRLF)