Skip to main content
Retrieves the keyboard properties of the device, such as its keyboard kind, layout, and key count.

Syntax

Parameters

info   _Out_
Type: GameInputKeyboardInfo*
Pointer to a GameInputKeyboardInfo structure that receives the keyboard properties of the device. If the device doesn’t support keyboard input, every member of the structure is set to zero.

Return value

Type: bool true if the device supports keyboard input and info was filled in; otherwise, false.

Remarks

The GetKeyboardInfo method copies the keyboard properties of the device into the caller-provided structure. A device supports keyboard input when the value returned by GetSupportedInput includes GameInputKindKeyboard. If the device doesn’t support keyboard input, GetKeyboardInfo zero-initializes info and returns false. Most keyboard properties are fixed for the lifetime of the device. The exception is the layout member, which GameInput updates in place when the active keyboard layout changes (for example, when the user switches input languages). When the layout changes, GameInput raises the GameInputDeviceEventKeyboardLayoutUpdated GameInputDeviceEvent to device callbacks registered with IGameInput::RegisterDeviceCallback. Call GetKeyboardInfo again from that callback to read the new layout. The following example shows how to query the keyboard properties of a device.
In GameInput v3 and earlier, this information was available from the keyboardInfo member of the GameInputDeviceInfo structure returned by IGameInputDevice::GetDeviceInfo.

Requirements

Header: GameInput.h Library: gameinput.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

Overview of GameInput
GameInputKeyboardInfo
GetSupportedInput
GameInputKind
IGameInput::RegisterDeviceCallback
GameInputDeviceEvent
IGameInputReading::GetKeyState
IGameInputDevice

Version History

Last modified on November 5, 2026