mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Small code style changes in keyboard change logic
This commit is contained in:
parent
d827d0ac9f
commit
4f2a951adf
1 changed files with 8 additions and 9 deletions
|
|
@ -464,19 +464,18 @@ namespace Flow.Launcher.Infrastructure
|
|||
// https://github.com/dotnet/winforms/pull/8573#issuecomment-1542600949
|
||||
//
|
||||
// NOTE: this logic may break in future versions of Windows since it is not documented.
|
||||
if (langId is (int)PInvoke.LOCALE_TRANSIENT_KEYBOARD1
|
||||
or (int)PInvoke.LOCALE_TRANSIENT_KEYBOARD2
|
||||
or (int)PInvoke.LOCALE_TRANSIENT_KEYBOARD3
|
||||
or (int)PInvoke.LOCALE_TRANSIENT_KEYBOARD4)
|
||||
if (langId is PInvoke.LOCALE_TRANSIENT_KEYBOARD1
|
||||
or PInvoke.LOCALE_TRANSIENT_KEYBOARD2
|
||||
or PInvoke.LOCALE_TRANSIENT_KEYBOARD3
|
||||
or PInvoke.LOCALE_TRANSIENT_KEYBOARD4)
|
||||
{
|
||||
using RegistryKey key = Registry.CurrentUser.OpenSubKey(UserProfileRegistryPath);
|
||||
if (key is not null && key.GetValue("Languages") is string[] languages)
|
||||
using var key = Registry.CurrentUser.OpenSubKey(UserProfileRegistryPath);
|
||||
if (key?.GetValue("Languages") is string[] languages)
|
||||
{
|
||||
foreach (string language in languages)
|
||||
{
|
||||
using RegistryKey subKey = key.OpenSubKey(language);
|
||||
if (subKey is not null
|
||||
&& subKey.GetValue("TransientLangId") is int transientLangId
|
||||
using var subKey = key.OpenSubKey(language);
|
||||
if (subKey?.GetValue("TransientLangId") is int transientLangId
|
||||
&& transientLangId == langId)
|
||||
{
|
||||
return language;
|
||||
|
|
|
|||
Loading…
Reference in a new issue