GetKeyboardLayoutList is a Windows API function that returns the list of keyboard layout handles currently loaded for the calling process. It is used by applications and system components to discover which input layouts are available, so they can switch or present them correctly.
What the function does in Windows input handling
GetKeyboardLayoutList is part of the Windows input stack, and its value is practical rather than theoretical: it tells a process which keyboard layouts are currently loaded so the application can present, enumerate, or switch them correctly. That makes it useful in user interface code, input method logic, remote desktop tooling, accessibility features, and system components that need to reflect the active language or keyboard state.
Because it reports loaded layout handles, the function is about discovery, not control. It does not create layouts or guarantee that a chosen layout is active, it only exposes what is already available to the calling process. In practice, that means developers still need to pair it with the relevant Windows input and windowing APIs when they want to change input behavior or respond to user selection.
Returned layout handles and what they represent
The list returned by GetKeyboardLayoutList consists of keyboard layout handles, which are identifiers Windows uses to reference loaded layouts for a process. Those handles are not human-readable labels, so a caller typically resolves them into a more understandable form before showing them to users. The function is therefore a discovery primitive that sits one step below the user experience layer.
That distinction matters because keyboard layout handling is process-scoped and stateful. An application may see multiple loaded layouts, but the presence of a handle does not mean a user is actively typing with it at that moment. Developers should treat the output as the current inventory of available layouts for that process context, not as a definitive statement about the user's immediate input mode.
Why application and system code uses it
The function is most useful when software needs to stay aligned with input expectations. Examples include showing the current language in a tray indicator, updating a keyboard picker in settings, preserving the right layout after a session change, or synchronizing an app's text-entry logic with the user's environment. It is also helpful in diagnostics, where support tools need to explain why a keyboard appears to behave differently on the same machine.
For developers, the main design question is whether the program is merely displaying input state or actively reacting to it. Discovery functions like this one are best used to observe and present the available layouts, while the rest of the input workflow handles activation, focus, and message processing. Keeping those roles separate reduces confusing edge cases in multilingual or remote-input scenarios.
Security and reliability considerations for input discovery
Input layout enumeration is usually a low-level operational concern, but it can still affect trust in user interaction. If software assumes the wrong layout, keystrokes may be interpreted incorrectly, shortcuts may misfire, and authentication or administrative actions can become harder to use safely. In environment where input is proxied, remoted, or injected, stale assumptions about the loaded layout can also create troubleshooting blind spots.
From a reliability perspective, the main failure mode is drift between what the process thinks is available and what the user actually experiences in the foreground window. That is why input-aware components should refresh state at meaningful boundaries such as focus changes, session transitions, or explicit user selection, rather than caching layout data indefinitely.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST CSF 2.0, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | ID.AM-01 — Physical devices and systems within the organization are inventoried | Covers discovering and inventorying user-facing input state in Windows environments |
| Recommendation — Inventory keyboard-layout-dependent endpoints and validate input-state assumptions in your asset and support workflows. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Applies where keyboard input state affects how credentials are entered and handled |
| Recommendation — Review input-dependent authentication workflows for layout-sensitive failures and user-entry errors. | ||
| CIS Controls v8 | CIS-5 — Account Management | Supports managing user interaction paths that depend on correct local input handling |
| Recommendation — Validate that account-related workflows remain usable when keyboard layouts change across sessions or locales. | ||
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 3, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org