Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to send underscore with Sendkeys in C#?

Tags:

c#

sendkeys

I've been bored, so I tried to make a program that writes a Look of Disapproval smiley(the ಠ_ಠ face) when pressing ctrl+shift+L. Now everything works, except for the underscore that is in the smiley, which won't get written at all.

This was what I used first:

SendKeys.Send("ಠ_ಠ");

I've tried various things, like adding {} brackets around the underscore, and of course I googled this too.

Is there any way I can get the underscore to get sent?

Thanks in advance.

like image 999
JeremyG Avatar asked Nov 21 '11 19:11

JeremyG


1 Answers

Mixing different encodings creates weird result. ಠ is Unicode, _ is ASCII. Different length characters confuse and iritate Visual Studio.

Try:

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

Or:

SendKeys.Send("\u0CA0\u005F\u0CA0");
like image 100
MPelletier Avatar answered Nov 02 '22 21:11

MPelletier