|
Answer» Hi!
I found over the net that in Windows 7 was possible in command line to get active KEYBOARD layout. By this Registry reading:
reg query "HKEY_CURRENT_USER\Keyboard Layout\Preload"
It displays installed layouts (not languages) in system, active will contain number 1. I used it and tried - no change of value. For to be sure I was searching for ID list - yes, found, but I have own layouts created with KbdEdit. These cannot to have any common ID, so I think I need only one simple thing - READ only active keyboard indication instead list with values without change - value I'll get I will take as important.
How to fix it? Or exist other way? Thank you all. MiroHi You can find the language CODES here May be those powershell commands can give you an idea You can execute it by cmd like this : This command returns the language list for the current user ACCOUNT and the corresponding display name.
Code: [SELECT]powershell -C Get-WinUserLanguageListThis command returns the list of currently enabled input methods as a TIP string.
Code: [Select]Powershell -C (Get-WinUserLanguageList)[0].InputMethodTipsThis command returns the autonym property of the first item in the user language list.
Code: [Select]Powershell -C (Get-WinUserLanguageList)[0].autonymDocumentation about Get-WinUserLanguageList You can make a batch file like this :
Code: [Select]echo off Title How to get active keyboard layout in command line ? for /f %%a in ('Powershell -C (Get-WinUserLanguageList^)[0].InputMethodTips') do Set "IMT=%%a" echo Active KeyBoard Code = %IMT%
for /f %%b in ('Powershell -C (Get-WinUserLanguageList^)[0].autonym') do set "CurrentLang=%%b" echo Active KeyBoard Language = %CurrentLang% pause Batch displays language but it looks inactive - I select other layout and no change.
Miro
|