mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Adjust formats
This commit is contained in:
parent
c63debe296
commit
4fc7f70d18
1 changed files with 5 additions and 16 deletions
|
|
@ -351,10 +351,7 @@ namespace Flow.Launcher.Infrastructure
|
||||||
fixed (HKL* h = handles)
|
fixed (HKL* h = handles)
|
||||||
{
|
{
|
||||||
var result = PInvoke.GetKeyboardLayoutList(count, h);
|
var result = PInvoke.GetKeyboardLayoutList(count, h);
|
||||||
if (result == 0)
|
if (result == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
|
||||||
{
|
|
||||||
throw new Win32Exception(Marshal.GetLastWin32Error());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for any English keyboard layout
|
// Look for any English keyboard layout
|
||||||
|
|
@ -364,10 +361,7 @@ namespace Flow.Launcher.Infrastructure
|
||||||
var langId = (uint)hkl.Value & KeyboardLayoutLoWord;
|
var langId = (uint)hkl.Value & KeyboardLayoutLoWord;
|
||||||
|
|
||||||
// Check if it's an English layout
|
// Check if it's an English layout
|
||||||
if (EnglishLanguageIds.Contains(langId))
|
if (EnglishLanguageIds.Contains(langId)) return hkl;
|
||||||
{
|
|
||||||
return hkl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return HKL.Null;
|
return HKL.Null;
|
||||||
|
|
@ -399,16 +393,10 @@ namespace Flow.Launcher.Infrastructure
|
||||||
// the IME mode instead of switching to another layout.
|
// the IME mode instead of switching to another layout.
|
||||||
var currentLayout = PInvoke.GetKeyboardLayout(threadId);
|
var currentLayout = PInvoke.GetKeyboardLayout(threadId);
|
||||||
var currentLayoutCode = (uint)currentLayout.Value & KeyboardLayoutLoWord;
|
var currentLayoutCode = (uint)currentLayout.Value & KeyboardLayoutLoWord;
|
||||||
if (ImeLanguageIds.Contains(currentLayoutCode))
|
if (ImeLanguageIds.Contains(currentLayoutCode)) return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Backup current keyboard layout
|
// Backup current keyboard layout
|
||||||
if (backupPrevious)
|
if (backupPrevious) _previousLayout = currentLayout;
|
||||||
{
|
|
||||||
_previousLayout = currentLayout;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Switch to English layout
|
// Switch to English layout
|
||||||
PInvoke.ActivateKeyboardLayout(enHKL, 0);
|
PInvoke.ActivateKeyboardLayout(enHKL, 0);
|
||||||
|
|
@ -431,6 +419,7 @@ namespace Flow.Launcher.Infrastructure
|
||||||
PInvoke.INPUTLANGCHANGE_FORWARD,
|
PInvoke.INPUTLANGCHANGE_FORWARD,
|
||||||
_previousLayout.Value
|
_previousLayout.Value
|
||||||
);
|
);
|
||||||
|
|
||||||
_previousLayout = HKL.Null;
|
_previousLayout = HKL.Null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue