Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
User Interaction
Keyboard Input
 GetKeyboardType function
GetKeyboardType function

Applies to: desktop apps only

Retrieves information about the current keyboard.

Syntax

int WINAPI GetKeyboardType(
  __in  int nTypeFlag
);

Parameters

nTypeFlag [in]

Type: int

The type of keyboard information to be retrieved. This parameter can be one of the following values.

ValueMeaning
0

Keyboard type

1

Keyboard subtype

2

The number of function keys on the keyboard

 

Return value

Type: int

If the function succeeds, the return value specifies the requested information.

If the function fails and nTypeFlag is not one, the return value is zero; zero is a valid return value when nTypeFlag is one (keyboard subtype). To get extended error information, call GetLastError.

Remarks

The type may be one of the following values.

ValueMeaning
1IBM PC/XT or compatible (83-key) keyboard
2Olivetti "ICO" (102-key) keyboard
3IBM PC/AT (84-key) or similar keyboard
4IBM enhanced (101- or 102-key) keyboard
5Nokia 1050 and similar keyboards
6Nokia 9140 and similar keyboards
7Japanese keyboard

 

The subtype is an original equipment manufacturer (OEM)-dependent value.

The application can also determine the number of function keys on a keyboard from the keyboard type. Following are the number of function keys for each keyboard type.

TypeNumber of function keys
110
212 (sometimes 18)
310
412
510
624
7Hardware dependent and specified by the OEM

 

When a single USB keyboard is connected to the computer, this function returns the code 81.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Keyboard Input Functions

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker