mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
PowerAccent-21300: fix passing unicode to SendInput API call (#22209)
[Quick Accent] Fix passing unicode to SendInput API call (#22209)
This commit is contained in:
@@ -26,13 +26,13 @@ internal static class WindowsFunctions
|
|||||||
System.Threading.Thread.Sleep(1); // Some apps, like Terminal, need a little wait to process the sent backspace or they'll ignore it.
|
System.Threading.Thread.Sleep(1); // Some apps, like Terminal, need a little wait to process the sent backspace or they'll ignore it.
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < s.Length; i++)
|
foreach (char c in s)
|
||||||
{
|
{
|
||||||
// Letter
|
// Letter
|
||||||
var inputsInsert = new User32.INPUT[]
|
var inputsInsert = new User32.INPUT[]
|
||||||
{
|
{
|
||||||
new User32.INPUT { type = User32.INPUTTYPE.INPUT_KEYBOARD, ki = new User32.KEYBDINPUT { wVk = 0, dwFlags = User32.KEYEVENTF.KEYEVENTF_UNICODE, wScan = (char)i } },
|
new User32.INPUT { type = User32.INPUTTYPE.INPUT_KEYBOARD, ki = new User32.KEYBDINPUT { wVk = 0, dwFlags = User32.KEYEVENTF.KEYEVENTF_UNICODE, wScan = c } },
|
||||||
new User32.INPUT { type = User32.INPUTTYPE.INPUT_KEYBOARD, ki = new User32.KEYBDINPUT { wVk = 0, dwFlags = User32.KEYEVENTF.KEYEVENTF_UNICODE | User32.KEYEVENTF.KEYEVENTF_KEYUP, wScan = (char)i } },
|
new User32.INPUT { type = User32.INPUTTYPE.INPUT_KEYBOARD, ki = new User32.KEYBDINPUT { wVk = 0, dwFlags = User32.KEYEVENTF.KEYEVENTF_UNICODE | User32.KEYEVENTF.KEYEVENTF_KEYUP, wScan = c } },
|
||||||
};
|
};
|
||||||
var temp2 = User32.SendInput((uint)inputsInsert.Length, inputsInsert, sizeof(User32.INPUT));
|
var temp2 = User32.SendInput((uint)inputsInsert.Length, inputsInsert, sizeof(User32.INPUT));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user