Hi
The System.Windows.Forms.SendKeys.Send method does not support sending Left or Right shift key. How can I send these keys in C#?

thanks in advance

Recommended Answers

All 5 Replies

SendKeys.Send("{your key code here}");

What do you mean?!!!!!!!
SendKeys.Send("+") sends shiftKey only. But Right shift key, for example, can not be distinguished by this way.

Looke here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=624210&SiteID=1

I tried keybd_event API function, but it doesn't work as expected! It can Not process Left or Right shift key correctly! This function only process Shift key. Take a look at this:
http://msdn.microsoft.com/en-us/library/ms646304(VS.85).aspx

Windows NT/2000/XP/Vista:This function has been superseded. Use SendInput instead.

Therefore, I tried to use SendInput function. But I couldn't! After that I found another note:
http://www.pinvoke.net/default.aspx/user32.SendInput

* VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys. * Used only as parameters to GetAsyncKeyState() and GetKeyState(). * No other API or message will distinguish left and right keys in this way. */

Now, Can anyone tell me how to send Left/Right Shift key?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.