2022年5月13日 星期五

ime

 https://p0w3rsh3ll.wordpress.com/2013/06/07/about-keyboard-layouts/

 https://social.technet.microsoft.com/Forums/en-US/2a46ae38-2202-4286-9b46-35bc6e60e861/what-command-can-be-run-from-the-cmd-to-inquire-about-the-language-layout-that-is-used-right-now?forum=w7itproui

 

For the current input language you can try using

reg query "HKCU\Keyboard Layout\Preload" /v 1

The return value includes an eight digit hex value. The first four digits indicate either default layout for the language (all zeros) or a variation (non-zero). The last four digits are the locale id - see:

http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx

From this table, you can see in the example above my input language is English - Australia.

For the keyboard layout you could try

WMIC Path Win32_Keyboard Get Layout

0409 is an English - US keyboard.

For a few other ideas/methods try reading

http://p0w3rsh3ll.wordpress.com/2013/06/07/about-keyboard-layouts/ 




About keyboard layouts
Posted on June 7, 2013   

A colleague from the helpdesk team recently asked if I could report the keyboad layout set before users log onto the computer.

I started digging into WMI classes by typing

Get-CimClass -ClassName *Keyboard*

Then did:

Get-CimInstance Win32_Keyboard

… and noticed the Layout property.

Both the MSDN page about the WMI Win32_Keyboard class…

…and the following powershell commands…

([wmiclass]'Win32_Keyboard').GetText("MOF")            
([wmiclass]'CIM_Keyboard').GetText("MOF")

…confirmed that the layout property is returned as a string value.

The problem with this value is that it’s not human readable and represents actually a hexadecimal value.



The problem with this value is that it’s not human readable and represents actually a hexadecimal value.
Although I can find the mapping of hexadecimal values to a user friendly value in the following registry key HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Keyboard Layout\DosKeybCodes, I decided to go another way.

First, do you know that you can use DISM.exe locally:

沒有留言: