Skip to content

Commit 44f03e8

Browse files
committed
Replace GetKeyboardLayout
1 parent d5d0dbc commit 44f03e8

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

src/Files.App.CsWin32/NativeMethods.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,4 @@ IQueryInfo
228228
QITIPF_FLAGS
229229
GetKeyboardState
230230
MapVirtualKey
231+
GetKeyboardLayout

src/Files.App/Data/Commands/HotKey/HotKey.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ private static string GetKeyCharacter(Forms.Keys key)
385385
var scanCode = PInvoke.MapVirtualKey(virtualKey, 0);
386386

387387
// Get the active keyboard layout
388-
var keyboardLayout = Win32PInvoke.GetKeyboardLayout(0);
388+
var keyboardLayout = PInvoke.GetKeyboardLayout(0);
389389

390390
if (Win32PInvoke.ToUnicodeEx(virtualKey, scanCode, state, buffer, buffer.Capacity, 0, keyboardLayout) > 0)
391391
return buffer[^1].ToString();

src/Files.App/Helpers/Win32/Win32PInvoke.Methods.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,6 @@ public static extern int ToUnicodeEx(
228228
IntPtr keyboardLayout
229229
);
230230

231-
[DllImport("user32.dll", CharSet = CharSet.Auto)]
232-
public static extern IntPtr GetKeyboardLayout
233-
(
234-
uint idThread
235-
);
236-
237231
[DllImport("user32.dll")]
238232
public static extern bool TranslateMessage(
239233
ref MSG lpMsg

0 commit comments

Comments
 (0)