question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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: image

.Net 7.0 result: image

Steps to reproduce

Repro steps:

  1. Create a new project with those 3 lines:
Thread.Sleep(5000);
            string test = "キ";
            SendKeys.SendWait(test);
  1. Run the project and (during the first 5 second since the start) open notepad
  2. Observe the test being written

or use attached test application: WinFormsApp56.zip

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
elachlancommented, Oct 18, 2022

The latest update didn’t fix it. It should be available in the next nightly build of CsWin32.

1reaction
Nora-Zhou01commented, Nov 3, 2022

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. 8 0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found