SendKeys.SendWait() sends wrong characters
See original GitHub issue.NET version
8.0.100-alpha.1.22512.32
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, can not repro in .Net 7.0 and previous versions
Issue description
SendKeys.SendWait() sends wrong characters for non-English characters, may be regressed from the PR change: https://github.com/dotnet/winforms/pull/7880
.Net 8.0 result:
.Net 7.0 result:
Steps to reproduce
Repro steps:
- Create a new project with those 3 lines:
Thread.Sleep(5000);
string test = "キ";
SendKeys.SendWait(test);
- Run the project and (during the first 5 second since the start) open notepad
- Observe the test being written
or use attached test application: WinFormsApp56.zip
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
SendKeys.SendWait() sends wrong characters for some ...
Forms Function SendKeys.SendWait() Reproduce steps: ... SendKeys.SendWait() sends wrong characters for some particular characters #2660.
Read more >c# - sendkeys types wrong character sometimes
# You could use user32.dll for example: # referenced: https://learn.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes namespace ...
Read more >How to send special characters by sendkeys.sendwait ...
You have a number of normal characters in your string surrounded by braces ( { and } ). These are not valid special...
Read more >SendKeys.Send(String) Method (System.Windows.Forms)
Each key is represented by one or more characters. To specify a single keyboard character, use the character itself. For example, to represent...
Read more >Faster SendKeys C# - Code Review Stack Exchange
SendWait is quite slow, you can see the characters being typed out gradually. It is a requirement to simulate the keyboard input faster....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The latest update didn’t fix it. It should be available in the next nightly build of CsWin32.
Verified with .NET SDK .NET 8.0.100-alpha.1.22552.10 build from main branch, this issue is fixed that the SendKeys.SendWait() sends the correct character.