Failed to send underscore using Sendkeys in C #?

I was bored, so I tried to create a program that writes the Look of Disapproval emoticon (face ಠ_ಠ) by pressing ctrl + shift + L. Now everything works, except for the underline, which is in the emoticon, which will not be written at all.

This is what I used first:

SendKeys.Send("ಠ_ಠ"); 

I tried different things, like adding {} brackets around the underscore, and of course, I was looking for this too.

Is there a way to get an underline message to send?

Thanks in advance.

+6
source share
2 answers

Mixing different encodings creates a strange result. is Unicode, _ is ASCII. Different characters of length confuse and iritate Visual Studio.

Try:

 SendKeys.Send("\u0CA0_\u0CA0"); 

Or:

 SendKeys.Send("\u0CA0\u005F\u0CA0"); 
+1
source

If you are not using an English keyboard layout that has an underscore as a key, you cannot just type the ASCII character, but you must write it as a combination of modifier and character keys.

0
source

Source: https://habr.com/ru/post/902043/


All Articles